• Peter Thompson 7
  • NEWBIE
  • 0 Points
  • Member since 2015

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 1
    Questions
  • 1
    Replies
​I have been hitting this error with our Trigger implementation and I could use some help in figuring out how to deal with it.

We have a managed package that we expose through the AppExchange
  • Someone installs, we get a lead created by the License Management Application within our org.
  • I have Lead Trigger that runs  "After Create"
  • The trigger is queueing an @future task to callout to “our service”
However, the LMA seems to be running in the context of a user from a different organization, and the @future call that I have is also running in this same user context.
The result is an exception:
Apex script unhandled exception by user/organization: 005x0000000xxxx/00Dx0000000xxxx
Failed to invoke future method 'public static void Report(String, String)' on class 'TriggerCallback' for job id '707i00000xxxxxx'
caused by: System.CalloutException: Callout loop not allowed
Class.TriggerCallback.Report: line 109, column 1

From my reaing online,it seems the callout is failing because it is running as the user in the LMA, which is not a user in out organization.  

Can I ignore this? Are the other scenarios that my trigger will run in the context of an external user?
Can I detect this and suppress this without trapping ALL CalloutExceptions?

Any suggestions would be much appreciated
 
​I have been hitting this error with our Trigger implementation and I could use some help in figuring out how to deal with it.

We have a managed package that we expose through the AppExchange
  • Someone installs, we get a lead created by the License Management Application within our org.
  • I have Lead Trigger that runs  "After Create"
  • The trigger is queueing an @future task to callout to “our service”
However, the LMA seems to be running in the context of a user from a different organization, and the @future call that I have is also running in this same user context.
The result is an exception:
Apex script unhandled exception by user/organization: 005x0000000xxxx/00Dx0000000xxxx
Failed to invoke future method 'public static void Report(String, String)' on class 'TriggerCallback' for job id '707i00000xxxxxx'
caused by: System.CalloutException: Callout loop not allowed
Class.TriggerCallback.Report: line 109, column 1

From my reaing online,it seems the callout is failing because it is running as the user in the LMA, which is not a user in out organization.  

Can I ignore this? Are the other scenarios that my trigger will run in the context of an external user?
Can I detect this and suppress this without trapping ALL CalloutExceptions?

Any suggestions would be much appreciated