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.


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


1 Answer 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;

You must log in to answer this question.

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