You need to sign in to do that
Don't have an account?
DJ 367
I want to display a hierarchy custom setting field to visualforce
Hi Everyone ,
I am new to salesforce and want to display a hierarchy custom setting field to visualforce. Can someone help me with the code.
Thanks in advance.
Dj
I am new to salesforce and want to display a hierarchy custom setting field to visualforce. Can someone help me with the code.
Thanks in advance.
Dj
This solved my problem. thannks.
All Answers
You can only access hierarchy custom settings in formula field and validation rules. Here is the generic syntax:
{!$Setup.CustomSettingName__c.CustomFieldName__c}
for the programatic implementation, ppease go throught the below link
http://developer.force.com/cookbook/recipe/using-custom-settings-to-display-data
Let me know if it resolves your query.
Regrds,
Rabi
thanks for your reply but still I am facing difficulty implementing my requirement. Can I post my requirement here.
I have one hierarchy custom setting field which is number data type and i have assigned it a value - 150(for eg CusSettfield__c = 150).
I have one vf page and there is a number field. my requirement is if I enter >100 into the vf field it should display error message.
This requirment i have to meet comparing custom setting field to the vf field.
if (Vffield < customSettingField )
error(value should be more than 150)... this just I have wriiten because I am not able to perform the code.
in another way I completed this requiremnet with validation but requirment is with custom setting.
thanks in advance.
Dj
<pre>
Decimal customSettingField = My_Custom_Setting__c.getInstance().CusSettfield__c;
</pre>
This solved my problem. thannks.
Let's assume we have some employee information stored in custom setting.
employee1 rollNo1
employee2 rollNo2
Syntax:
Employee__c obj=new Employee__c.getvalues('employee1');
String rolNo=obj.rollNo1__c;
For more detail visit,
https://www.sfdc-lightning.com/2018/09/custom-settings-in-salesforce.html