Skip to main content

Notifications

Microsoft Dynamics NAV (Archived)

Tracking Specification Purchase Order

Posted on by 265

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

  • Suggested answer
    Avinash B Profile Picture
    Avinash B 1,455 on at
    RE: Tracking Specification Purchase Order

    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.

  • Rikarddo Profile Picture
    Rikarddo 265 on at
    RE: Tracking Specification Purchase Order

    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.

  • Suggested answer
    Avinash B Profile Picture
    Avinash B 1,455 on at
    RE: Tracking Specification Purchase Order

    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

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,253 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,188 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans