I want to insert a new record in CRM's custom entity where one of the fields is of lookup type i.e. new_contactid
and it is dependent on the contact
entity.
I have also referred Set Values of all Data Types using Web API in Dynamics CRM Through C#.
My JSON data is as below:
{
"new_transactionnumber":"114",
"new_transactionamount":650,
"new_transactiondate":"2018-01-29T15:01:00.000Z",
"[email protected]":"/contacts(afb9e006-6be5-e711-80ed-bef806786223)",
"[email protected]":"/new_moves(896f2dcd-b2fa-e711-80ef-bef806786223)"
}
Here, last 2 fields are for lookup GUID. Original field names are:
- new_contactid
- new_moveid
What I have added to the end is it's primary key's entity name.
Please let me know if I am missing anything in here.
EDIT 1: Below is the references I found in OData file for lookup field:
<NavigationProperty Name="new_contact_new_transaction_contactid" Type="Collection(mscrm.new_transaction)" Partner="new_contactid" />
<Property Name="_new_contactid_value" Type="Edm.Guid">
<Annotation Term="Org.OData.Core.V1.Description" String="ContactId" />
<Annotation Term="Org.OData.Core.V1.Computed" Bool="true" />
<Annotation Term="Org.OData.Core.V1.Permissions">
<EnumMember>Org.OData.Core.V1.PermissionType/Read</EnumMember>
</Annotation>
</Property>
<NavigationProperty Name="new_contactid" Type="mscrm.contact" Nullable="false" Partner="new_contact_new_transaction_contactid">
<ReferentialConstraint Property="_new_contactid_value" ReferencedProperty="contactid" />
</NavigationProperty>
<NavigationPropertyBinding Path="new_contact_new_transaction_contactid" Target="new_transactions" />
<NavigationPropertyBinding Path="new_contactid" Target="contacts" />
EDIT 2: These lookup fields are GUID bound to other existing entity's primary key.