I have a requirement for a managed package that we are developing. I need to make an API callout to an external system when user is assigned to the package (hybrid package on user based pricing model). The ideal solution would be to have a trigger in the UserPackageLicense object to do this. However, UserPackageLicense doesn't support triggers at the moment. Can anyone suggest a work around?

Thanks in Advance

  • According to SOAP API Developer Guide, it supports DML. Could you not create a Custom Object that almost mirrors the UserPackageLicense? – Dan Jones Nov 8 '16 at 13:06
  • Yeah. I know it supports DML. But the thing is the assignment happens from the standard Manage Licenses UI. So, I am wondering on what action I can create custom object record that mirrors UserPackageLicense. – Suresh Kumar Nov 8 '16 at 15:03
  • If I'm understanding you right (sorry if I'm not!), given that assignment happens from the standard UI, why not do the actions in a Custom Object instead? Then if a licence is updated on the Custom Object, update UserPackageLicense, if a licence is created in the Custom Object, create one in UserPackageLicense? – Dan Jones Nov 8 '16 at 15:05
  • @DanJones Thanks for your interest in clarifying this further. When I say "from standard UI", I am talking about the Manage Licenses screen which is used to provide access for users to the package. By what you are saying, I believe we may need to come up with our own custom page to do this assignment. I am not sure if we can override the Manage License screen with custom page – Suresh Kumar Nov 10 '16 at 7:07
  • 2
    Does your callout needs to be instant? If not then you can create a scheduled job to query UserPackageLicense records with creation date is <=now-15 min then if query returns records you can send callouts accordingly. You'll only need to schedule job to run every 15 min after writing the scheduled class. – tugce Nov 15 '16 at 13:35

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.