Quantcast
Channel: Forum CRM Development
Viewing all articles
Browse latest Browse all 1000

How to get all attributes name of the Particular entity?

$
0
0

Hi All,

I need to know from where we can get the attribute list of any antity.

Please see below code as example:

 private void DisplayAllEmailActivities(IOrganizationService service)
        {

            QueryExpression qe = new QueryExpression();
            qe.ColumnSet = new ColumnSet(new string[] { "activityid", "activitytypecode" });
            qe.EntityName = "activitypointer";

            FilterExpression filterStateCode = new FilterExpression();
            filterStateCode.FilterOperator = LogicalOperator.Or;
            filterStateCode.AddCondition("statecode", ConditionOperator.Equal, "Open");
            filterStateCode.AddCondition("statecode", ConditionOperator.Equal, "Scheduled");

            FilterExpression filter = new FilterExpression();
            filter.FilterOperator = LogicalOperator.And;
            //filter.AddCondition("regardingobjectid", ConditionOperator.Equal, entityRecordGuid);
            //filter.AddCondition("CreatedOnBehalfByYomiName", ConditionOperator.Like, "salesarchive Archive");
            filter.AddFilter(filterStateCode);

            qe.Criteria = filter;

            RetrieveMultipleRequest request = new RetrieveMultipleRequest();
            request.Query = qe;
            RetrieveMultipleResponse response = (RetrieveMultipleResponse)service.Execute(request);
            int i =0;
            foreach (Entity activity in response.EntityCollection.Entities)
            {
                Response.Write("Record " + i.ToString() + " :" + activity.Id + "<BR>");
                i++;
            }

        }

Here, "activitypointer" is entity, Can we say it table name from CRM database?

Also, "regardingobjectid" is shown as an attribute here, Can we say this is the column name it table?

Please help.

Thank you in Advance.

Dhaval Panchal


Viewing all articles
Browse latest Browse all 1000


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