Hi All,
i am trying to update "Is Searchable" flag programmatically.

Through the UI, i can set it :

but i cannot change it via SDK.
RetrieveAttributeRequest attributeRequest = new RetrieveAttributeRequest
{
EntityLogicalName = Account.EntityLogicalName,
LogicalName = " accountratingcode",
RetrieveAsIfPublished = true
};
RetrieveAttributeResponse attributeResponse =
(RetrieveAttributeResponse)_serviceProxy.Execute(attributeRequest);
Console.WriteLine("Retrieved the attribute {0}.",
attributeResponse.AttributeMetadata.SchemaName);
AttributeMetadata retrievedAttributeMetadata =
attributeResponse.AttributeMetadata;
retrievedAttributeMetadata.IsSearchable = true;
// Update an attribute retrieved via RetrieveAttributeRequest
UpdateAttributeRequest updateRequest = new UpdateAttributeRequest
{
Attribute = retrievedAttributeMetadata,
EntityName = Account.EntityLogicalName,
MergeLabels = false
};
// Execute the request
_serviceProxy.Execute(updateRequest);
but it says:
Error CS0200 Property or indexer 'AttributeMetadata.IsSearchable' cannot be assigned to -- it is read only
Can someone help me? i did not find any related doc!
*This post is locked for comments
I have the same question (0)