1

I have an external object lookup in case. I have a scenario when a record inserted or updated on the case. If the type and subtype field condition matches, I have to check the external object field values and accordingly I have to update the case Status.

Am trying to write external object query in the trigger but its throwing error

Cannot not reference the external objects in the trigger.

Why do I get this error? How can I fix it?

  • 1
    Hi AJ, any time you get an error, please include its message text verbatim. – Adrian Larson Jul 15 at 13:43
  • Thanks, Adrian Larson! Do we have any other possibilities am asking? – AJ Sagar Jul 16 at 11:55
3

You can create triggers on external change data capture events from OData 4.0 connections

Apex Considerations for Salesforce Connect External Objects

Use External Change Data Capture to Track Data Changes on External Objects

  • Thank, Oleh Berehovskyi! My requirement Is I want to Query External Data on Case trigger? – AJ Sagar Jul 16 at 11:54
0

Even though documentation is not very clear about how the external objects work it seems that in a sync transaction you cannot access external objects. Try to run a method with @future notation to update your case based on the data of the external object.

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.