1

I want to assign the value of Standard field 'NewValue' of the object 'CaseHistory' to a TEXT type field of another custom object. Is it possible ? The datatype of 'NewValue' field is 'anyType' as per the below link.

https://developer.salesforce.com/docs/atlas.en-us.api.meta/api/sforce_api_objects_casehistory.htm.

And if I try to assign the 'NewValue' field value to any other TEXT type custom field like (CSHU.New_Status_Value__c = CH.NewValue;) then it throws me error saying:

Error: Compile Error: Illegal assignment from Object to String

Thanks!

1 Answer 1

1

As the error states the datatype of the NewValue field on a Case History is an Object .You may typecast into a String like below

CSHU.New_Status_Value__c = (string)CH.NewValue;
0

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .