2

We are busy with a managed package but we want to use a bit of an other license management then the normal flow. In the normal flow you can control the users that have access via the license managent org. But we want to control the number of records somebody already created.

My thought was to check the number of records in a trigger on that object and then block the user from creating if he exceeds the number we specified. We could store the number in a custom setting that we set private so only apex can access it.

Now my question is, is this a good approach and most of all how can i update that number from the LMA org when the customer decides to buy additional records or change his license?

Do we need to patch that customer's org? or is there a better way?

Thank you for your help

Sven

0

Pushing data into a subscriber org is not possible via the LMA natively.

Salesforce has said that 'feature licenses' are on the roadmap for ISVs to assign which would be perfect for your use case. But you know .. "on the roadmap" can mean so many things

If you have login access to your orgs (via a dedicated service user (either OAuth or user/pass/token)), you could automate this process by adding a trigger to your License object. You could add a custom field to License called 'max records' and when you update that value, the trigger could enqueue a bit of Apex code to do a REST API update to a custom Apex REST endpoint that you have installed into the org to update the Custom Setting. The Apex REST endpoint will be necessary if you're using a protected Custom Setting and the down side of creating your own API to manipulate the Custom Setting is that any API user with sufficient access to that Apex class will be able to invoke it.

| improve this answer | |

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.