You need to sign in to do that
Don't have an account?
Nagireddy Manohar
Why Hierarchy custom settings are required. if we can achieve same through list custom settings.
Why Hierarchy custom settings are required. if we can achieve same through list custom settings.
Example:
while creating data in Hierarchy custom settings, we need to select user or profile, we can acess those values in apex by using below piece of code.
CustomSettingName__c mc = CustomSettingName__c.getInstance(Profile_ID);
CustomSettingName__c mc = CustomSettingName__c.getInstance(User_ID);
If we use list custom setting, while creating data if we give name as userid or profileid, we can access those values in apex by using below piece of code.
CustomSettingName__c mc = CustomSettingName__c.getValues(userinfo.getuserid());
CustomSettingName__c mc = CustomSettingName__c.getValues(userinfo.getprofileid());
So we can achieve using list custom settings also .Then what is the main use of Hierarchy custom settings comapred to list custom settings?
Please let me know is there any specific reason to create Hierarchy custom settings?.
Thanks & Regards,
N. Manohar
Example:
while creating data in Hierarchy custom settings, we need to select user or profile, we can acess those values in apex by using below piece of code.
CustomSettingName__c mc = CustomSettingName__c.getInstance(Profile_ID);
CustomSettingName__c mc = CustomSettingName__c.getInstance(User_ID);
If we use list custom setting, while creating data if we give name as userid or profileid, we can access those values in apex by using below piece of code.
CustomSettingName__c mc = CustomSettingName__c.getValues(userinfo.getuserid());
CustomSettingName__c mc = CustomSettingName__c.getValues(userinfo.getprofileid());
So we can achieve using list custom settings also .Then what is the main use of Hierarchy custom settings comapred to list custom settings?
Please let me know is there any specific reason to create Hierarchy custom settings?.
Thanks & Regards,
N. Manohar
May I suggest you please check with below Jeff Douglas blog which has a clear explanation on using hierarchy custom settings and list custom settings with scenarios.
- http://blog.jeffdouglas.com/2010/02/08/using-hierarchy-custom-settings-in-salesforce-com/
Please let us know if the information helps.Regards,
Nagendra.