web
You’re offline. This is a read only version of the page.
close
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

I have the same question (0)
  • Suggested answer
    Neville Foyn Profile Picture
    4,320 on at

    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

  • ahmed barbary Profile Picture
    4,548 on at

    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
    4,320 on at

    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
    4,548 on at

    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

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics NAV (Archived)

#1
HoangNam Profile Picture

HoangNam 7

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans