You need to sign in to do that
Don't have an account?
Raffaele Messina
Dynamic object instantiation
Hello everybody
I am currently ttying to insert records into Salesforce using apex; the records i need are saved as .csv files inside Salesforce in the ContentDocument object. I can get the name of the object from the name of the file, that will be for example: backup_Account_mm/dd/yyy. So i can only get the name of the obj as a string.
How can i build the logic for inserting records (.csv file) based on the object, considering that the objects can change, and i'd rather not use hard coding.
Thanks in advance
For example something like: You might want to go a step further and make sure the CSV data value is the correct data type - for that you'd need to describe the object, i.e. Account, get the fields, and based on the field data type cast the correct type on the "csvData.get(field);" line