Skip to main content
Dynamics 365 general forum
Suggested answer

Lookup Field Help

editSubscribe (0) ShareShare
ReportReport
Posted on by UG Leader

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
Attachments
  • 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 UG Leader 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

New Blog Features Released!

Check out the new community blog features for viewers and authors…

Setting Up Knowledge Sources for Copilot…

Look at how configuring a comprehensive knowledge base is crucial…

Demystifying Copilot with Georg Glantschnig…

Industry experts answer burning questions directly from our amazing Community…

Leaderboard

#1
Andre Arnaud de Calavon Profile Picture

Andre Arnaud de Cal... 283,126 Super User

#2
Martin Dráb Profile Picture

Martin Dráb 222,646 Super User

#3
nmaenpaa Profile Picture

nmaenpaa 101,138

Featured topics

Product updates

Dynamics 365 release plans