It's not working. My objective is that when I open a form (the Routing Line form), the operation number appears. The operation number, since there's only one entry per item, is always 1. This is what I have from the processing report from yesterday (in the item data item):
RecRoutingLine.RESET;
RecRoutingLine.SETRANGE("Routing No.","No.");
IF RecRoutingLine.FINDSET THEN BEGIN
IF "Tempo Fabrico Machos" > 0 THEN BEGIN
RecRoutingLine."Run Time" := "Tempo Fabrico Machos";
RecRoutingLine.MODIFY;
MESSAGE('%1', RecRoutingLine."Run Time");
END
END
ELSE BEGIN
RecRoutingHeader.RESET;
RecRoutingHeader.SETRANGE("No.","No.");
RecRoutingHeader."No." := "No."; //Nº da tabela item
RecRoutingHeader.Description := Description;
RecRoutingHeader.INSERT;
RecRoutingHeader.Status := RecRoutingHeader.Status::Certified;
RecRoutingHeader.MODIFY;
RecRoutingLine.RESET;
RecRoutingLine.SETRANGE("Routing No.","No.");
RecRoutingLine."Routing No." := "No."; //Nº da tabela item
RecRoutingLine."Work Center No." := "Work Center No.";
RecRoutingLine."Work Center Group Code" := "Work Center Group Code";
RecRoutingLine."Operation No." := FORMAT(1);
RecRoutingLine."Run Time" := "Tempo Fabrico Machos";
RecRoutingLine.INSERT;
IF "Tempo Fabrico Machos" > 0 THEN BEGIN
RecRoutingLine."Run Time" := "Tempo Fabrico Machos";
RecRoutingLine.MODIFY;
END
END
What are you expecting from Not Working?
your question is to insert integer in Code..
FORMAT works perfectly for that..
if it is not working in your scenario means you have identify the mistake in your code..
You were right. The item I was testing with already had a Routing Line and Header, although I really don't know how it was created (my supervisor told me these were not created automatically). I got it. Sorry for bothering. Thank you for helping me!
so that I can insert an operating number to the items that already have a Routing Line and Header. I tried to do it here:
IF RecRoutingLine.FINDSET THEN BEGIN
IF "Tempo Fabrico Machos" > 0 THEN BEGIN
RecRoutingLine."Run Time" := "Tempo Fabrico Machos";
RecRoutingLine."Operation No." := FORMAT(1);
RecRoutingLine.MODIFY;
Comments
Code := FORMAT(Integer)?
-Mohana
http://mohana-dynamicsnav.blogspot.in/
https://www.facebook.com/MohanaDynamicsNav
Regards,
Raveendran.BS
What are you expecting from Not Working?
your question is to insert integer in Code..
FORMAT works perfectly for that..
if it is not working in your scenario means you have identify the mistake in your code..
-Mohana
http://mohana-dynamicsnav.blogspot.in/
https://www.facebook.com/MohanaDynamicsNav
-Mohana
http://mohana-dynamicsnav.blogspot.in/
https://www.facebook.com/MohanaDynamicsNav
With the above code, if I didnt get routing lines with item then it will create header and lines with operation No 1..
and it is working..
you have to identify why these solutions are not working for you..
-Mohana
http://mohana-dynamicsnav.blogspot.in/
https://www.facebook.com/MohanaDynamicsNav
-Mohana
http://mohana-dynamicsnav.blogspot.in/
https://www.facebook.com/MohanaDynamicsNav
create a new item and try..
-Mohana
http://mohana-dynamicsnav.blogspot.in/
https://www.facebook.com/MohanaDynamicsNav
-Mohana
http://mohana-dynamicsnav.blogspot.in/
https://www.facebook.com/MohanaDynamicsNav
but it's not working.
we have to delete the line and insert again
-Mohana
http://mohana-dynamicsnav.blogspot.in/
https://www.facebook.com/MohanaDynamicsNav