This is one of the common requirement in ADXStudio to set values in Lookup Fields in Entity Forms. Initially it was very difficult for me to get the solution of this but finally i got the way. Here is the solution :
Suppose we are exposing Case Entity Form on ADXStudio Portal and we have a Customer Lookup on that form and i want to set value in this lookup field-
Step 1 : Get Lookup IDs
Right Click on Lookup Field and Click Inspect to see rendered HTML or press F12. You will find three IDs of that lookup field:
Name ID ; customer_name
Guid ID : customerid
EntityName ID : customer_entityname
Same for other lookup you will find same IDs but with different names.
So same as CRM Lookups, ADXStudio also keep three values for each lookup rendered on portal forms.
Step 2: Set values in Lookup Fields
$(\”#customer_name\”).attr(\”value\”,\”A J E CALDER LTD\”);
In first line i have set the name of record, in second line i have set the guid and in third line i have set the name of entity to which this record belongs.
So this way we can set value in any of the lookup field in ADXStudio Entity Forms.