Skip to main content

Notifications

Microsoft Dynamics NAV (Archived)

Autofill field based on another field

Posted on by Microsoft Employee

Hi,

I have following problem, i need to fill Document Date and Shipment Date based on Posting Date, kind of like set those two fields default values to Posting Date,But if users wants they can change dates.

Does anyone know how to manage that? Its Microsoft table 36 and pages 42, 43.

Thank you!

*This post is locked for comments

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Autofill field based on another field

    Thanks, i found solution yesterday and it was exact same code, you understood my question correctly :)

    Thanks!

  • Verified answer
    Marcellus Profile Picture
    Marcellus 2,735 on at
    RE: Autofill field based on another field

    Hi Linards,

    I think that's how standard NAV works. When you create a new order the Shipment Date, Order Date and the Posting Date will be set to the workdate and the users can change them. 

    In the InitRecord() method in the Sales Header table 36 you can see this code snippets (these are just lines from the method this is not what it actually looks like):

    IF "Document Type" IN ["Document Type"::Order,"Document Type"::Invoice,"Document Type"::Quote] THEN
      BEGIN
      "Shipment Date" := WORKDATE;
      "Order Date" := WORKDATE;
    END;
    IF NOT ("Document Type" IN ["Document Type"::"Blanket Order","Document Type"::Quote]) AND
       ("Posting Date" = 0D)
    THEN
      "Posting Date" := WORKDATE;
    "Document Date" := WORKDATE;
    


    I apologise if I don't understand your question correctly.

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