Quantcast
Channel: CRM Development forum
Viewing all articles
Browse latest Browse all 8223

How to get Name/FullName/Title field attribute dynamically -CRM 2011

$
0
0

Hi,

I want to get the name attribute value For all entities in CRM. So I am creating a dynamics fetch expression query to retrieve the entity-related records. But In CRM 2011 this attribute name is not common.

For example

1. Account has 'Name'

2. Contact has 'fullname'

3 incident has 'title' etc.

 string fetch1 = @"
                        <fetch mapping='logical'>
                        <entity name='account'>
                        <attribute name='name'/>
                        <filter type='and'>
                        <condition attribute='accountid' operator='eq' value='[GUID]' />
                        </filter>

                        </entity>
                        </fetch> ";

            fetch1 = fetch1.Replace("[GUID]", ContactId);fetch1 = fetch1.Replace("account", entityname);

Can you please help me to make appropriate attribute name based on the entity.

Thanks in advance.

-Prem


Viewing all articles
Browse latest Browse all 8223

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>