function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Lynn  M GrandeLynn M Grande 

Has anyone successfully achieved test coverage on apex classes that are querying external Lightning connect objects?

Is there any updates wrt creating test classes for apex that queries external objects?
RaidanRaidan
Hi Lynn,

To insert test data to an external object, you will have to use the Database.insertAsync() method.
External_Object__x extObj = new External_Object__x(ExternalId='12345', DisplayUrl='https://mydomain.com/12345');
Database.insertAsync(extObj);