I’m trying to get the fields of a parent entity, but I don’t get all the fields, only some of them.
Entity parentEntity = service.Retrieve("entityname", id, new ColumnSet(true));
While debugging, I see some of the customly defined attributes of the custom entity in the returned entity, but some of them are missing. For example, I’m getting the integer values of the option lists, but not the value of a value field. There’s no such property in the retrieved entity.
It is a plugin that fires post update event.
Any help will be appreciated.
Thanks.
You will only get attributes that have been populated (that have a value in the database).
The attributes collection may contain some other bits as well, such as system values and the Id, but for standard fields generally speaking you only get the fields which have value returned.
For example if you have a contact record with the following data:
First name: James
Last name: Wood
Then:
contact.Attributes will contain ‘firstname’ and ‘lastname’. But wont contain ‘middlename’.
(As a side using
new ColumnSet(true)should generally be avoided when you can).