How to restrict Sandbox LMA License to match Production License Status/Count?

If your AppExchange package includes a free trial, in Production the app installs well with TRIAL as the status. However, it appears as free in sandbox orgs.

Is there a way to have Sandbox org installation follow the same licensing model that is configured to your package. When "a free trial" is offered, sandbox should get a trial license of x days instead of not active (does not expire).

For apps which can be used in Sandbox and serve the purpose, I need a mechanism to make the app behave as Trial for x days in Sandbox as well.

1 Answer 1


Free orgs get a free site-wide license to the package as well. There's no way to restrict this feature. It's designed to be used for trial/evaluation purposes.

  • My question is, particularly around Sandboxes? Mar 8, 2019 at 10:33
  • @ChiragMehta That's correct, all packages get free licenses in Sandbox orgs.
    – sfdcfox
    Mar 8, 2019 at 11:40
  • yep, so coming back to my question is there a way to stop that and force similar policy as production for sandboxes too? maybe using some apex code which updates sandbox licenses record with expiry date whenever relevant prod license record is updated ?? Mar 26, 2019 at 6:13
  • @ChiragMehta No, there's no way to control this behavior.
    – sfdcfox
    Mar 26, 2019 at 13:06
  • I was able to achieve this by running apex logic in the form of batch program. Oct 9, 2019 at 6:51

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .