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
*This post is locked for comments
Since it is using the temporary record, the value will not be committed to the database, and when you use the local/global variable (in your case variable LotNoInformation) to find the record, it will always try to fetch the data from the database.
hence the record you will be searching will not be found.
Thanks for the tips.
Just one observation, i'm adding the code when closiing the lot no. information page after created the lot. Then it should fill up the expiration date on the item tracking lines.page.
But i will get a look on those code units.
Hi
This might be because the Tracking Specification is used as a temporary table.
When closing the Item tracking lines page, the information is transferred to the table "Reservation Entry".
So you should use the table reservation entry to perform your operation which will be automatically flown to Tracking Specification table.
You can also refer to the codeunit "Reservation Engine Mgt.", and "Create Reserv. Entry".
Regards
Avinash B
Stay up to date on forum activity by subscribing. You can also customize your in-app and email Notification settings across all subscriptions.
André Arnaud de Cal... 291,253 Super User 2024 Season 2
Martin Dráb 230,188 Most Valuable Professional
nmaenpaa 101,156