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
Rakshith RamachandraRakshith Ramachandra 

Create a global constant in SalesForce

I'm trying to get percentage quota for each user. It's basically Number of calls made * 100 / Expected quota. Expected quota remains the same for all users. Currently I've created a new field called quota and duplicated the same value across the table. Is there a way I can create a global constant called quota and assign a value to it to use it in a formula?
Praveen KHariPraveen KHari
You can use hierarchy custom settings in formula fields.
This blog have more details

http://blog.jeffdouglas.com/2010/02/08/using-hierarchy-custom-settings-in-salesforce-com/

-Praveen K Hari
Praveen KHariPraveen KHari
You can also user custom label for this. 

http://lunego.com/blog/sfdc-referencing-labels/

-Praveen K Hari
Rakshith RamachandraRakshith Ramachandra
I'm not sure if that is what I want. Maybe I didn't explain myself properly. I want save a constant which can be accessed anywhere inside salesforce using the name. For example: Let's say I want Discount = 5. I create a variable Discount and assign value 5 to it. I should be able under global constants in formulas. Can I do that in Salesforce?
Mohit mohit 24Mohit mohit 24
You can create a apex class and you need to define a variable into it with values. Now you can access those variables using ClassName.VariableName