I am trying to find dependencies for a CRM entity attribute on C # code, but I cannot find the correct path.
The code is as follows:
var attributeRequest = new RetrieveAttributeRequest
{
EntityLogicalName = "invoice",
LogicalName = "billto_city"
};
var attributeResponse = (RetrieveAttributeResponse)proxy.Execute(attributeRequest);
var dependenciesRequest = new RetrieveDependenciesForDeleteRequest
{
ObjectId = (Guid)attributeResponse.AttributeMetadata.MetadataId,
ComponentType = (int)attributeResponse.AttributeMetadata.AttributeType
};
var dependenciesResponse = (RetrieveDependenciesForDeleteResponse)proxy.Execute(dependenciesRequest);
Gives a negative result. I believe it is wrong to use an attribute MetadataIdlike ObjectId. But, apparently, it is impossible to recognize the attribute ObjectIdfor the attribute.
Has anyone encountered a similar problem before? How did you solve it?
source
share