Created
April 26, 2021 10:32
-
-
Save mhamzas/b0fa92c15598470f613351ec47a49a3a to your computer and use it in GitHub Desktop.
Inserting sObject Record Dynamically in Salesforce
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| String objName = 'Account'; | |
| String recordName = 'Salesforce'; | |
| sObject sObj = Schema.getGlobalDescribe().get(objName).newSObject(); | |
| sObj.put('Name', recordName) ; | |
| Insert sObj ; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment