TargetRetrieveDynamic target = new TargetRetrieveDynamic();
RetrieveRequest retrieveRequest = new RetrieveRequest();
RetrieveResponse retrieveResponse = null;
DynamicEntity entity = null;
Guid appointmentGuid = new Guid("A970380F-F07C-DE11-9838-00E0812D4948");
target.EntityName = "appointment";
target.EntityId = appointmentGuid;
//initialize request parameters
retrieveRequest.ColumnSet = new AllColumns();
retrieveRequest.ReturnDynamicEntities = true;
retrieveRequest.Target = target;
//build the response object
retrieveResponse = (RetrieveResponse)service.Execute(retrieveRequest);
//retrieve the service order item from the response
entity = (DynamicEntity)retrieveResponse.BusinessEntity;
foreach(Property p in entity.Properties)
{
Console.WriteLine(p.name);
}
|