Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics NAV (Archived)

transfer due date in release production order to consumption journal posting date

(0) ShareShare
ReportReport
Posted on by 4,548

Hi guys i try to get due date in release production order come or transfer  in consumption journal automatically but it not come i don't know the problem :

what i need is to transfer date found in release production order (due date) to posting date in request form  of calc consumption(function-cal consumption-option-posting date) in default it take work date but i need due date in place of work date. so that i write this code to achieve this task

in open form of request form of report 5405


IF "Prod. Order No." = '' THEN
  EXIT;

ProdOrderLine.RESET;
ProdOrderLine.SETRANGE(Status,ProdOrderLine.Status::Released);
ProdOrderLine.SETRANGE("Prod. Order No.","Prod. Order No.");
IF ProdOrderLine.FIND('+') THEN
due_date:= ProdOrderLine."Due Date" ;

then i replace workdate with due_date global variable as date data type

InitializeRequest(due_date,CalcBasedOn::"Expected Output");

then

in createconsujinl function i write

  ItemJnlLine.VALIDATE("Posting Date",due_date);

but when i run and open request form again after i make release production order  and got to consumption journal it give me empty posting date text box

why and how i solve this problem.

thanks

*This post is locked for comments

  • ahmed barbary Profile Picture
    ahmed barbary 4,548 on at
    RE: transfer due date in release production order to consumption journal posting date

    I write this code on pre data item in production order table on report 5405 calc consumption report

    RESET;

    SETRANGE(Status,Status::Released);

    SETRANGE("No.","No.");

    IF FIND('+') THEN

    //ProdNo:= "No." ;

    due_date:= "Due Date" ;

    VALIDATE("Due Date",due_date);

    what i need when  press function button and select calc consumption then select no due date goted in posting date in request form.How i do that are this code wrong.

    to your notes i make that because useres in my company register data before 3 monthes so that i need due date come based on last record released production order

    please help me

    thanks

  • Suggested answer
    Neville Foyn Profile Picture
    Neville Foyn 4,320 on at
    RE: transfer due date in release production order to consumption journal posting date

    Hi

    You need to check what the code is doing while it runs

    In the classic client, Click on tools -> debugger -> and make sure both options are ticked

    Then run the report and use F8 to step through the code while looking at the record values in the bottom section of the debugger, check to see if the system is finding the released production order and retrieving the date.

    You should see what the issue is by using the debugger

    Cheers

    Nev

  • ahmed barbary Profile Picture
    ahmed barbary 4,548 on at
    RE: transfer due date in release production order to consumption journal posting date

    Can you tell me more details my version is Microsoft dynamic nav 2009 r2 classic and i write my code in request form because posting date i want to assign it found in this form . and until now i don't know how i solve this problem

    thanks

  • Suggested answer
    Neville Foyn Profile Picture
    Neville Foyn 4,320 on at
    RE: transfer due date in release production order to consumption journal posting date

    Hi

    From your previous questions i think you are using the 2009 RTC and not the classic client

    You say you are writing the code in the request FORM (Not the request PAGE), this means that the code will not run in the RTC, you will need to move it to the request page to see it work in the RTC

    Before moving it to the page however, switch on the debugger and run through the code step by step in the classic client to see if it is running the code you have written and what records it finds when looking for the due date, this will let you know it works as it should before you move it to the RTC

    Cheers

    Nev

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

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Vahid Ghafarpour – Community Spotlight

We are excited to recognize Vahid Ghafarpour as our February 2025 Community…

Tip: Become a User Group leader!

Join the ranks of valued community UG leaders

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 292,494 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 231,305 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans