Skip to main content

Notifications

Announcements

No record found.

Supply chain | Supply Chain Management, Commerce
Answered

New form line init with the value from form header

(0) ShareShare
ReportReport
Posted on by

Hi, all,

When I change the field (which is shared for header table and line table) in header level, and try to add a new line, the field I changed before doesn't been initialized with any value.  Only I refresh the whole form(press F5) and add a new line can initialize the value correctly .

I tried to add headerTable_ds.reread() or headerTable_ds.refresh() in lineTable_ds.initValue(), but it is useless.
Could anybody tell me how to init the correct value for the lineTable when creating?


What is the root cause for this? I mean, if I have many fields shared for header and line tables, I don't want to add the field one by one in code. Will change the mapping between two lines help or something else?

Thank you for your help.

  • Verified answer
    Kai Cheng Profile Picture
    Kai Cheng on at
    New form line init with the value from form header
    Finally, I uptake a framework and add a method to refresh the lineTable from HeaderTable manually.
     
    Thanks for the help!
  • Suggested answer
    Mohit Rampal Profile Picture
    Mohit Rampal 12,550 Super User 2024 Season 1 on at
    RE: New form line init with the value from form header

    How about refreshing the header datasource at modifiedField method or Write method of form Header Datasource, instead of initValue at line level. You also have to update existing lines.

  • Kai Cheng Profile Picture
    Kai Cheng on at
    RE: New form line init with the value from form header

    Hi, Mohit, I see the link you shared, it provides me a good solution to hook the update of header table.

    I am curious that is there any better solution here?

  • Suggested answer
    Mohit Rampal Profile Picture
    Mohit Rampal 12,550 Super User 2024 Season 1 on at
    RE: New form line init with the value from form header

    Hi Kai, Have you checked this thread

    community.dynamics.com/.../update-field-record-from-header-to-line-in-project-quotation

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

Congratulations 2024 Spotlight Honorees!

Kudos to all of our 2024 community stars! 🎉

Meet the Top 10 leaders for December!

Congratulations to our December super stars! 🥳

Get Started Blogging in the Community

Hosted or syndicated blogging is available! ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

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

#2
Martin Dráb Profile Picture

Martin Dráb 230,354 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans