I wanted to store user id in an org cache, so I have I created a partition and added data in org cache.

Example :

  Cache.OrgPartition orgPartition = Cache.Org.getPartition('local.UserDetailCache');
  if(orgPartition.contains('keyUserId')) {
      System.debug('retrieved user id ' + orgPartition.get('keyUserId'));

Now am able to get the user id since put and get is in same function.

When I try to get user id from some other function then it is returning null.

put on hold as unclear what you're asking by Phil W, battery.cord, identigral, EazyE, zuzannamj Nov 9 at 19:41

Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.

  • Hi. Please read How to Ask then edit your question to provide all the details you have omitted. – Phil W Nov 8 at 10:49
  • I added few lines to elaborate. – user70573 Nov 8 at 11:10
  • Can you see the stored cached data in the Partition tool ? To access the Partition tool in Setup, enter Platform Cache in the Quick Find box, then select Platform Cache – Shamina Nov 8 at 15:06
  • Yes I can see the amount of data stored with the help of that chart in KB under Platform cache.But my question is can I able to see the data which I stored in the cache. – user70573 Nov 11 at 4:36
  • I got an answer. Thanks for all. My question is where can I find the org cache data and the answer is , under Platform cache, when I click on diagnostic, we can able to see the cache org keys. It solved my question. – user70573 2 days ago

Browse other questions tagged or ask your own question.