Retrieving values from lookup entity relationships without using webservices

Note the values that you want to pull through need to be on the lookup view of that entity. Item in bold is the key part.

//Defines the lookup entity to retrieve values from

var lookup = crmForm.all.<<LookupField>>;

if(lookup .DataValue != null)

{

//Using key values to retrieve the value of the item from the lookup entity. Items[0] refers to the selected instance of the entity of the form.

 var lookupfieldvalue =  lookup.items[0].keyValues.<<field_on_lookup_view>>.value;

}

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s