Tuesday, June 19, 2007

How to get name value from a CRM lookup - Primary Field/ Primary value diff?!

How to get name value from a lookup in CRM table?

if you have a lookup (foreign key) in your CRM table you can easily access its GUID but what if you want to get its name associated?

You may probably think that you may have to goto the parent table and pull name column value. Well, thats true but the easier way is to just append the name to the attribute in the referential table.

Example -
Guest (Primary table), has columns (GuestID, Name)
Reservations (Referential/child table), has columns (ResID, ResDate, .... GuestID(fkey/lookup type)

When you access Resrevations you can directly get GuestID (GUID) AND Guest Name (appending name) through the entity exposed by the CRM web service.

Check this -

More background on why this is or how this is check the Understanding CRM Metadata: PrimaryKey and PrimaryField article by MSCRM. Thanks - Dipesh

No comments: