Skip to main content

Notifications

Announcements

No record found.

Customer experience | Sales, Customer Insights,...
Suggested answer

Dynamics 365 xrm.navigation.openForm (relationship parameter)

Posted on by 25
hello everyone
i fire a javascript function working on subgrid ribbon button (create new) i want to map data of the current record (parent entity) to the quick view in the child entity when the form is open ..
Any help
  • Suggested answer
    Bipin D365 Profile Picture
    Bipin D365 28,964 Super User 2024 Season 1 on at
    RE: Dynamics 365 xrm.navigation.openForm (relationship parameter)

    Hi,

    Quickview control is used to display data from related entity.

    If you want to set field from parent entity record to child record on click on new form button, you can make use of formparameters. see below code.

    var entityFormOptions = {};

    entityFormOptions["entityName"] = "contact";

    entityFormOptions["useQuickCreateForm"] = true;

    // Set default values for the Contact form

    var formParameters = {};

    formParameters["firstname"] = "Sample";

    formParameters["lastname"] = "Contact";

    formParameters["fullname"] = "Sample Contact";

    formParameters["emailaddress1"] = "contact@adventure-works.com";

    formParameters["jobtitle"] = "Sr. Marketing Manager";

    formParameters["donotemail"] = "1";

    formParameters["description"] = "Default values for this record were set programmatically.";

    // Open the form.

    Xrm.Navigation.openForm(entityFormOptions, formParameters).then(

       function (success) {

           console.log(success);

       },

       function (error) {

           console.log(error);

       });

    Quick view field can not be set using this approach. if you have lookup field on child entity form that you can set using above approach. Once you set lookup field on child entity form, automatically related fields from lookup entity will be displayed in quick view control.

    If found helpful, Please mark my answer verified.

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

Featured topics

Product updates

Dynamics 365 release plans