Inserting sObject Record Dynamically in Salesforce
Sample Code:
String objName = 'Account'; String recordName = 'Salesforce'; sObject sObj = Schema.getGlobalDescribe().get(objName).newSObject(); sObj.put('Name', recordName) ; Insert sObj ;
Sample Code:
String objName = 'Account'; String recordName = 'Salesforce'; sObject sObj = Schema.getGlobalDescribe().get(objName).newSObject(); sObj.put('Name', recordName) ; Insert sObj ;