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()
.
Do I get to define the
namespace
as part of my managed package's config (aka package components)? If yes, lets call my namespacesfdcSe
Do I get to define the
partition
name as part of my managed package's config (aka package components)? If yes, lets call my partitioncoolIsvPartition
When I create a cache partition in my dev org, I can not set the
Namespace Prefix
tosfdcSe
- it is hard coded tolocal
. How do I test my code in my dev org? I think the correct way to write it isCache.Org.put('sfdcSe.coolIsvPartition.myKey', 'value');
HOWEVER I can't definesfdcSe
namespace in Setup > Platform Cache Partition. My hope is I can just writeCache.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).