Sample Code:
Account acc = new Account(Name = 'TestAccountName', AccountNumber = '234567', Industry= 'IT');
/* Code to convert Account to test string */
String strTest = Test .serialize(Acc);
system.debug('Test String is ' + strTest );
/* Code to convert Test string to Account */
Account Acc1 = (Account)Test .deserialize(str Test , Account.Class);
system.debug('Account is ' + Acc1);
Account acc = new Account(Name = 'TestAccountName', AccountNumber = '234567', Industry= 'IT');
/* Code to convert Account to test string */
String strTest = Test .serialize(Acc);
system.debug('Test String is ' + strTest );
/* Code to convert Test string to Account */
Account Acc1 = (Account)Test .deserialize(str Test , Account.Class);
system.debug('Account is ' + Acc1);
No comments:
Post a Comment