Hi,
I'm trying to implement a code that calculates on the tracking specification table the expiration date automatically.
This is the procedure.
Select a line of purche order, go to item tracking lines page( tracking specification table) . Assign a random lot, and fill up that information. On close that page it should calculate the expiration date with
the production order before imputed.
item.GET("Item No.");
LotNoInformation.RESET;
LotNoInformation.SETRANGE("Item No.","Item No.");
LotNoInformation.SETRANGE("Lot No.","Lot No.");
IF LotNoInformation.FIND('-') THEN
IF FORMAT(item."Expiration Calculation")<>'' THEN
BEGIN
expdatetemp:=CALCDATE(item."Expiration Calculation",LotNoInformation."Production Date");
TrackingSpecification.MODIFY;
END//Ric
But it gives me an error "the tracking specification does not exist mov. nº 0"
Please some help, or if there is another way to calculate that field
Thanks in advance
Answers
Where did you add your code?
expdatetemp appears to be a variable; TrackingSpecification is not assigned to.
Have you considered to do your modification in the same place as the standard functionality using item."Expiration Calculation", which is (mainly) Table 83 Item Journal Line?
I'm adding the code on trigger close page of 6508.
check out the WriteToDatabase functions and you'll realize it is not as straight forward to do this as you might have thought.