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
TomSnyderTomSnyder 

Reflect the properties of a custom class

Is there anyway to reflect the properties of a custom class [like the output of system.debug(myClass);] into a string variable.

 

 

Best Answer chosen by Admin (Salesforce Developers) 
TomSnyderTomSnyder

Thought this didn't work before but I just checked and works now.

 

string reflection = String.valueOf(new MyClass());