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
Serge DevSerge Dev 

Global variables set by user input accessible via apex classes?

Is it possible to have a global variable in apex classes that is set (once) by the user via an apex page (form) within Salesforce?

The next time the user logs in or a different user logs into the same salesforce org the global variable would ideally be already set.
Ankit AroraAnkit Arora
You can't maintain the variable value in Apex, value can be hold for one thread (for one action). So best is if you can create a custom setting and keep the value over there, and whenever needed just pull the value from custom setting. Make sense?