You need to sign in to do that
Don't have an account?
Logesh
Sample Test class for controller containing SOQL query for External Object
Hi Friends,
Does anyone have sample test class for apex class which has soql query for External Objects? Kindly share.
Thanks,
Loges
Does anyone have sample test class for apex class which has soql query for External Objects? Kindly share.
Thanks,
Loges
System.UnexpectedException: java.sql.SQLException: A callout failed because an Apex operation has pending uncommitted work. The Apex code needs to commit or roll back before callouts can be performed in the same transaction. Attempted callout URL: {0}
in test class i
https://help.salesforce.com/apex/HTViewSolution?id=000079772&language=en_US
I have an external database I'm connected to via an odata connection. It consists of a Member table and various other tables with FKs referring to the Member ID.
What I am trying to do is use the process builder to trigger an apex method to do a SOQL query against the Member table to get the ID and populate a custom field on the Contact object. Here is my code:
Here is the error I'm getting:
After googling this error, it seems like you cannot simply query an external data source along with other DML operations as they need to be async. However, when I move my code to a method annotated with @Future, I get this error:
I'm not sure what I'm supposed to do at this point. Thanks in advance for any help.