It means that it didnt find machine Center with RecRoutingLine.“Routing No.”…
Did it show correct routing line description all the times?
It means that it didnt find machine Center with RecRoutingLine.“Routing No.”…
Did it show correct routing line description all the times?
Yes, the description is the correct one. It just doesn’t show up on the form…
May be it has been replaced by something else code or design of your dataport…
I don’t know…I’ve been looking at this for at least a couple of days and I still didn’t figure it out…
People, I really need help…
I made it.
Here is my final version of the code
RecRoutingHeader.RESET;
RecRoutingHeader.SETRANGE(“No.”,“Routing No.”);
IF NOT RecRoutingHeader.FINDFIRST THEN BEGIN
RecRoutingHeader.“No.” := “Routing No.”;
RecRoutingHeader.Description := RecItem.Description;
RecRoutingHeader.Status := RecRoutingHeader.Status::Certified;
RecRoutingHeader.INSERT;
END;
RecRoutingLine.RESET;
RecRoutingLine.SETRANGE(“Routing No.”, RecRoutingHeader.“No.”);
RecWorkCenter.RESET;
RecWorkCenter.SETRANGE(“No.”, “Routing Line”.“Work Center No.”);
RecWorkCenterGroup.RESET;
RecWorkCenterGroup.SETRANGE(Code, “Routing Line”.“Work Center Group Code”);
RecCapacityUnitOfMeasure.RESET;
RecCapacityUnitOfMeasure.SETRANGE(Code, ‘MIN’);
//IF NOT RecRoutingLine.FINDFIRST THEN BEGIN
RecRoutingLine.Description := ‘’;
RecRoutingLine.“Routing No.” := “Routing No.”;
RecRoutingLine.“Operation No.” := “Operation No.”;
RecRoutingLine.“Work Center No.” := “Work Center No.”;
RecRoutingLine.“Work Center Group Code” := “Work Center Group Code”;
RecRoutingLine.Type := RecRoutingLine.Type::“Machine Center”;
RecRoutingLine.“No.” := “No.”;
RecRoutingLine.“Run Time” := “Run Time”;
RecRoutingLine.“Run Time Unit of Meas. Code” := FORMAT(‘MIN’);
RecRoutingLine.VALIDATE(“Run Time Unit of Meas. Code”);
RecRoutingLine.VALIDATE(“No.”);
IF RecRoutingLine.FIND THEN BEGIN
RecRoutingLine.“Run Time Unit of Meas. Code” := FORMAT(‘MIN’);
RecRoutingLine.MODIFY;
END ELSE BEGIN
RecRoutingLine.“Run Time Unit of Meas. Code” := FORMAT(‘MIN’);
RecRoutingLine.INSERT;
END;
IF RecRoutingLine.FINDFIRST THEN BEGIN
RecRoutingLine.VALIDATE(“No.”);
RecRoutingLine.“Run Time Unit of Meas. Code” := FORMAT(‘MIN’);
RecRoutingLine.MODIFY;
END;
Till before you wrote code for machine center and now you changes it to work center…
If you dont know the requirement correctly no body can help you…
What is the purpose of this code?
RecWorkCenter.RESET;
RecWorkCenter.SETRANGE(“No.”, “Routing Line”.“Work Center No.”);
RecWorkCenterGroup.RESET;
RecWorkCenterGroup.SETRANGE(Code, “Routing Line”.“Work Center Group Code”);
RecCapacityUnitOfMeasure.RESET;
RecCapacityUnitOfMeasure.SETRANGE(Code, ‘MIN’);
It does not appear to do anything or server any purpose.
I’m glad you found a solution, though. Now the most important question: Do you understand why every one of those lines of code you wrote needs (or doesn’t need) to be there?
Yes, I know.
They were part of a solution I was trying but didn’t work, and I left them there…
I already deleted them from the code. Thanks for the warning!
I think little by little, I’m understanding a little bit more (today I had another task and although it was relatively simple, I managed to do it by myself, and, therefore, didn’t post anything here). Thanks for all the help you’ve been giving me, and will still give me, hopefully…