Skip to main content

Notifications

Announcements

No record found.

Dynamics 365 general forum
Suggested answer

Lookup Field Help

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.

Helpful resources

Quick Links

Replay now available! Dynamics 365 Community Call (CRM Edition)

Catch up on the first D365 Community Call held on 7/10

Community Spotlight of the Month

Kudos to Saurav Dhyani!

Congratulations to the June Top 10 community leaders!

These stars go above and beyond . . .

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 288,768 Super User

#2
Martin Dráb Profile Picture

Martin Dráb 225,985 Super User

#3
nmaenpaa Profile Picture

nmaenpaa 101,148

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans