DynamicEntity someEntity;
TargetRetrieveDynamic retrieveTarget = new TargetRetrieveDynamic();
retrieveTarget.EntityId = <id of entity>;
retrieveTarget.EntityName = EntityName.<entity name>.ToString();
RetrieveRequest retrieveRequest = new RetrieveRequest();
retrieveRequest.ColumnSet = new ColumnSet(new string[] { "your_custom_attribute" });
retrieveRequest.ReturnDynamicEntities = true;
retrieveRequest.Target = retrieveTarget;
RetrieveResponse retrieveResponse = (RetrieveResponse)service.Execute(retrieveRequest);
someEntity = retrieveResponse.BusinessEntity as DynamicEntity;
String result = (String)someEntity["your_custom_attribute"];
String value = result.Value.ToString();
No comments:
Post a Comment