I want to store a text value that I can easily modify using apex. I want to use it to change the behaviour of a visual flow depending of the value in this field.

  • I think about custom metadata type but need to use SOAP API to modify it.
  • Static resources can only store files if I'm right.
  • I found Custom Label can't be modify with DML in apex

If it's not possible, what solution should I use?

  • 1
    Custom Settings? – kurunve Feb 13 '19 at 11:18

You can use Platform cache either Org cache or Session cache based on your detailed requirement.

Here is an usage:

// Get partition
Cache.OrgPartition orgPart = Cache.Org.getPartition('local.CurrencyCache');
// Add cache value to the partition. Usually, the value is obtained from a 
// callout, but hardcoding it in this example for simplicity.
orgPart.put('DollarToEuroRate', '0.91');
// Retrieve cache value from the partition
String cachedRate = (String)orgPart.get('DollarToEuroRate');

For more information, refer Get Started with Platform Cache

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.