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
    Commented Jul 15, 2019 at 13:43
  • Thanks, Adrian Larson! Do we have any other possibilities am asking?
    – AJ Sagar
    Commented Jul 16, 2019 at 11:55

2 Answers 2


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
    Commented Jul 16, 2019 at 11:54

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.

You must log in to answer this question.

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