Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
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,554 Moderator 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,554 Moderator 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

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,516 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 231,401 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans