简体   繁体   中英

Two lookups to the same entity pre-filled in creation mode

I have a customised Entity X and I have two lookups to account, and when I want to create a record of entity X from account, I find myself with a form with the two lookups of account prefiled by the name of the account I started from. I need to make one of those two lookups not pre-filled by the name of the main account in creation mode, is it possible to do this? Thanks in advance,

Clear the field in the form's onload event, like this:

if (Xrm.Page.ui.getFormType() === 1) {
   Xrm.Page.getAttribute("new_myaccountid").setValue(null);
}

Go to Relationships for your entity and find the Relationship for the Lookup that you want left blank. Open it and go to Mappings and remove the mapping to the parent account.

Mappings define which fields get mapped from the parent to the child when creating a child from the parent.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM