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
Mohsinkhan PathanMohsinkhan Pathan 

using sobject to fetch custom setting

Hi Team,

I want to fetch custom setting in List using sobject and compare it with values in excel sheet. If the value of excel sheet column matches the custom settings name, than update the field of that custom setting. I am not getting any relevant information related to this.Not sure if this can be done. Any help would be appreciated. Thanks in advance.

Regards,
khan
Prakash NawalePrakash Nawale
Hi Mohsinkhan,

In Salesforce we can't read excel file, you have to use javascript plugins to read excel file, then covert the data in wrapper class with seralize method of JSON class in apex.

Fetch Custom setting and build map for Column names from custom setting and iterate over JSON data and use if statement if match update custom setting field value etc.

https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_customsettings.htm