Skip to main content

We're trying to revamp our sandbox refresh processes.

 

I originally tried to implement a solution using custom metadata types, but I believe I've run into a limitation that the SandboxPostCopy Interface Method cannot reference/update CMDT (but it can reference/update custom settings).

 

Therefore, I was directed to use Custom Settings, which have obvious limitations...

 

As I was about to begin the custom settings approach, I came across the Apex Metadata API group. It doesn't look like this API is currently being further developed, but maybe it can help with my current use case.

 

I also came across this UnofficialSF component that may have some potential for my use case (I'm trying to get justification with my ops team to try it in our dev org): https://unofficialsf.com/save-and-update-custom-metadata-records-using-flow/

https://github.com/jongpie/CustomMetadataSaver

 

My resulting question: Can the SandboxPostCopy Interface work together with the Apex Metadata API to update custom metadata settings in a sandbox, post refresh? I've seen some mention about a session ID is required to use the Apex Metadata API, and that the SandboxPostCopy Interface uses a special user without a session ID.

3 réponses
  1. 9 juil. 2024, 13:37

    Sushil and Frans,

     

    Thank you for the great perspective here.

     

    At this time, we're only at the design aspect of our eventual solution. We hadn't run into an actual conflict / blocker yet, but I ran into this post mentioning it wasn't possible to utilize custom metadata in the SandboxPostCopy Interface. After seeing that, I went to Salesforce support, and they confirmed the SandboxPostCopy Interface could not directly reference custom metadata, but it looks like the support agent was unaware of the Apex Metadata API. 

     

    I am going to update the relevant idea Salesforce support made for me, as well as the post I referenced above, to point them here that this can be done using the Apex Metadata API. Once we develop our solution, I'll plan to report back as well. 

     

    Best,

     

    Jack 

0/9000