Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics 365 | Integration, Dataverse...
Suggested answer

Set lookup filed value in related entity using JS

Posted on by

Hi,

The Product and Supplier entity has 1:N relationship where I have product lookup on supplier entity and subgrid on product entity. On creation of Supplier record from product subgrid, I would need to set the product record in supplier entity product field. 

Could anyone please help with JS code for this business logic.

Thanks,

Leo

  • Suggested answer
    Leah Ju Profile Picture
    Leah Ju Microsoft Employee on at
    RE: Set lookup filed value in related entity using JS

    Hi Leo,

    If you create Supplier record from the sub-grid of product, the product lookup on supplier entity will be populated automatically without any customizations.

    The Product and Supplier entity has 1:N relationship, so field mapping will be created automatically between productid(Product) and product lookup field(Supplier).

    Field mapping is a mechanism that maps one field to another, allowing data to be copied between corresponding records.

    pastedimage1668740859128v1.png

    Test:

    pastedimage1668743176186v2.png

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,269 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,198 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Product updates

Dynamics 365 release plans