function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
mikumiku 

I write the cls to track the field history.But I don't know how to write the test

every custom object has a history object called objecthistory.

I use the object to track the custom object field. It works ok. But I don't know how to writte the test code.because the historyobject is readonly.

Shashikant SharmaShashikant Sharma

History object record will not be crated in test Context so when ever you will update any field on your Custom Object you will not see History records for it in test Method Context.