I'm using dynamics crm 2016, my mission is to copy a record in client side (no plugins) so using onload event I'm calling a function that fetching an object with all my attributes(to be copy to..), I can fill simply all fields in my form except from lookup field. I have in my data from my fetch 3 values to use: name: the data shown in the field' value: the guid of the entity reference and a number of type.. To populate a lookup field I need the name of the entity the id and type. ***THE code needs to be generic Two questions rise up:
1.Is the type value usable to populate the entity type field if yes then how?
2.Can I populate the name attribute in the new field as is from the old field?
Example of the data that I get :
Attributes
:
name
:
"this is the name"
type
:
"10026" -- Can I get the entity name (Account,Contact etc...) according to this val?
__proto__
:
Object
Value
:
"{6BddfDC-8B10-47F4-BC49-A537d2E43E}"