Skip to main content

Notifications

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

Lookup Field Help

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

Hi, 

So I am looking at creating a child record to an account, however, when pushing over the ID from the parent to the child's lookup input I am receiving this value:

pastedimage1604071490126v1.png

When this value is clicked on, it takes the user to the correct Account, but as you can see the display name is showing (No Name), the code for this that I use is within a button on the ribbon and reads as follows:

function myFunctionThree() {

//Parent form and fields    
var z = Xrm.Page.data.entity.getId();
//var x = Xrm.Page.getAttribute("name").getValue()

//Desired Form
var entityFormOptions = {};
entityFormOptions["entityName"] = "incident";

//Desired Fields
var formParameters = {};
formParameters["customerid"] = z;
//formParameters["customername"] = x;


//Testing
console.log(x);

// Open the form.
Xrm.Navigation.openForm(entityFormOptionsformParameters).then(
    function (success) {
        console.log(success);
    },
    function (error) {
        console.log(error);
    });
}
Hopefully there is a fix for this as it does set once it is saved.
Thanks,
Jay
  • Suggested answer
    TylerS.Dev Profile Picture
    TylerS.Dev 725 on at
    RE: Lookup Field Help

    this is more of a suggestion but you might want to use formContext instead of Xrm.Page because it has been depreciated.

    docs.microsoft.com/.../clientapi-form-context

  • Suggested answer
    Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Lookup Field Help

    Update!

    I have managed to solve this as I have discovered that the Lookup field requires an array of data to be pushed into for the Object, ID and Name.

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…

Announcing Forum Attachment Improvements!

We're excited to announce that attachments for replies in forums and improved…

Vahid Ghafarpour – Community Spotlight

We are excited to recognize Vahid Ghafarpour as our February 2025 Community…

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,969 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 230,842 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Product updates

Dynamics 365 release plans