SHARE
TWEET

Untitled

a guest Jul 24th, 2019 68 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. @AuraEnabled
  2. public static string saveAllData(list<object> allData,string objectName){
  3.     system.debug('allData'+allData);
  4.     map<string,string> IbjMap=new map<string,string>();
  5.     Map<String, Schema.SObjectField> fieldMap = Schema.getGlobalDescribe().get(objectName).getDescribe().Fields.getMap();
  6.     Schema.SObjectType targetType = Schema.getGlobalDescribe().get(objectName);
  7.     list<Sobject> ObjList=new List<SObjcet>();
  8.    for(object sobj:sobjectList){
  9.                 Sobject sobjRecord = targetType.newSObject();
  10.                 sobjRecord = sobj.clone();  
  11.                   sobjectList.add(sobjRecord);
  12.             }
  13.  
  14.     insert ObjectList;
  15.     return null;
  16. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top