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
mahamed raheemmahamed raheem 

how to insert sobject list values in dynamically

List<sobject> tmpOutput = (list<sobject>)JSON.deserialize(str,list<sobject>.class);
[temOutput-->contains one secnario account object and another scenario contains custom objects ]
how to insert sobject list values 
in my secnario i need to insert all custom and standard
objects records   at time in dynamically
vijay kumar kvijay kumar k
Hi Mahmed

List<Sobject> records will do dml operations as useuall.

Like : 
List<Sobject>listobj = new List<Sobject>();
Account a=new Account(Name='Test Account');
Contact c = new Contact(LastName='Test Contact');
listobj.add(a);
listobj.add(c);
insert listobj;

So you should take care of while (list<sobject>)JSON.deserialize(str,list<sobject>.class). Check the output.

Other than this nothing to add here.

Are you facing any issues while doing DML Operations? If yes please share the errors here will figure out the solution.

Useful link: https://salesforce.stackexchange.com/questions/147234/dml-operation-on-listsobjects-where-i-got-the-record-id-of-various-objects

Regards
Vijay