Skip to main content

Notifications

Announcements

No record found.

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

How to auto populate lookup value in a form using Xrm.Navigation.navigateTo

Posted on by 5
I am using below function on click of a button. I need to auto populate related project name in field. Display Name of field is Project and Name of the field is "abc_project". What should I pass in query string (data)?
OpenNewRequestPopup = () => {
    let qs = "_abc_project_value={11111111-1111-1111-1111-111111111111}"
    var pageInput = {
      pageType: "entityrecord",
      entityName: "abc_resourcerequest",
      data: encodeURIComponent(qs),
    }

    var navigationOptions = {
      target: 2,
      width: { value: 50unit: "%" },
      position: 1,
    }
    console.log(pageInput)
    Xrm.Navigation.navigateTo(pageInputnavigationOptions).then(
      function success() {},
      function error() {}
    )
  }
  • a33ik Profile Picture
    a33ik 84,323 Most Valuable Professional on at
    RE: How to auto populate lookup value in a form using Xrm.Navigation.navigateTo

    Try to use following code:

    var pageInput = {

    pageType: "entityrecord",

    entityName: "abc_resourcerequest",

    data: {

    abc_project: "11111111-1111-1111-1111-111111111111"

    }

    };

    var navigationOptions = {

    target: 2,

    width: { value: 50, unit: "%" },

    position: 1

    };

    console.log(pageInput);

    Xrm.Navigation.navigateTo(pageInput, navigationOptions).then(

    function success() {},

    function error() {});

  • Suggested answer
    Carlo Velasco Profile Picture
    Carlo Velasco 787 on at

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

#2
Martin Dráb Profile Picture

Martin Dráb 230,235 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Product updates

Dynamics 365 release plans