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

Error deploying apex trigger to production

Trying to deploy this trigger to production. Received following error message:
 Methods defined as TestMethod do not support Web service callouts 
Stack Trace: null

trigger updateOppField on Account(before insert, before update){
     for(Account acc :{
         if(acc.Text_ID__c != null){
             acc.A_Opportunity__c = acc.Text_ID__c;
Any ideas/solutions will be greatly appreciated.

Shashi PatowaryShashi Patowary

In one of the test classes, you are trying to call a method that is actually calling a Webservices.Please rewrite the test class to do a mock callout.

You can find an example of doing this at this link -

Please let me know if this is helpful.

Abhishek BansalAbhishek Bansal

It seems like you are including a test class in your change set and in that test class you are trying to make a web service callout that is not supported by Salesforce.
This trigger does not have any error.
The issue here is with your test class which you need to fix.
You can get the help from below link to make your test class run correctly :

Let me know if you need more help or information on this.

Ezdhan Hussain S KEzdhan Hussain S K
Hello Rom,
Callouts are not supported in test methods. To test callouts you need to develop Mock requests and response.

Refer below link for more help (" target="_blank)

If that helps mark it as best Answer. Cheers..!