3

I'd like to make an ISV App / Managed package that uses the Platform Org Cache.

The clearest directions on how to do this are described in this trailhead. However, when writing my code, I am unclear what to specify for the namespace and partition when using Cache.Org.put() and Cache.Org.get().

  1. Do I get to define the namespace as part of my managed package's config (aka package components)? If yes, lets call my namespace sfdcSe

  2. Do I get to define the partition name as part of my managed package's config (aka package components)? If yes, lets call my partition coolIsvPartition

  3. When I create a cache partition in my dev org, I can not set the Namespace Prefix to sfdcSe - it is hard coded to local. How do I test my code in my dev org? I think the correct way to write it is Cache.Org.put('sfdcSe.coolIsvPartition.myKey', 'value'); HOWEVER I can't define sfdcSe namespace in Setup > Platform Cache Partition. My hope is I can just write Cache.Org.put('local.coolIsvPartition.myKey', 'value'); and it will work both in my org OR if installed into another.

Thanks in advance, I'm new to SFDC development so sorry if some of the terminology is wrong.

UPDATE: For clarification, lets keep the scope of this question to 1st Generation Packaging. A complete answer that covers 1GP and 2GP would be nice, but is not required to solve this problem (I don't think).

Your Answer

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

Browse other questions tagged or ask your own question.