web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Small and medium business | Business Central, N...
Answered

"The request was blocked by the runtime" Error When Sending Sales Invoices to API in BC Cloud

(5) ShareShare
ReportReport
Posted on by 322
Hi
 
I have an error that appears when I try to send a sales invoice to API . It gives me the following error:
 
Error "The request was blocked by the runtime to prevent accidental use of production services."
 
AL Code:
------------------------------------------------------------------------------------------------------------------------------------------
 HttpRequestMessage.SetRequestUri('https://backend.jofotara.gov.jo/core/invoices/');
        HttpRequestMessage.Method := 'POST';
        HttpRequestMessage.Content := RequestContent;
 
        if not HttpClient.Send(HttpRequestMessage, HttpResponseMessage) then begin
            SaveBarcodeValue(Rec."No.", 'Error');
            Error('Failed to call the API.');
        end;
------------------------------------------------------------------------------------------------------------------------------------------
Before : 200 OK
 
After :  400 Error
 
 
How do I solve the problem and what are the proposed solutions?
 
 
I have the same question (0)
  • Verified answer
    Gerardo Rentería García Profile Picture
    25,234 Most Valuable Professional on at

    Hi, good day
    I hope this can help you, and give you some hints.

    The request was blocked by the runtime to prevent accidental use of production services. - TharangaC

    Best Regards
    Gerardo

  • CU09091051-0 Profile Picture
    322 on at

    Dear gdrenteria,

     

    I hope this message finds you well.

    I would like to sincerely thank you for your support and collaboration. Your dedication and professionalism are truly appreciated and have made a significant difference.

     

     

  • Suggested answer
    Khushbu Rajvi. Profile Picture
    20,448 Super User 2025 Season 2 on at
  • Ramesh Kumar Profile Picture
    7,527 Super User 2025 Season 2 on at
  • Suggested answer
    Mehak Seetlani Profile Picture
    33 on at
    Hi, 
     

    If you encounter the error message "The request was blocked by the runtime to prevent accidental use of production services," it means that outbound HTTP calls from your Business Central app or extension are blocked by default. To enable outbound HTTP requests, go to Extension Management, locate your extension, and choose Configure. On the Extension Settings page, ensure that Allow HttpClient Requests is enabled. This setting must be configured for each extension that requires external communication, including any library apps it depends on. Once enabled, your extension will be able to make outbound HTTP calls without restrictions.

    Reference: https://learn.microsoft.com/en-us/dynamics365/business-central/dev-itpro/developer/methods-auto/httpclient/httpclient-post-method

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > Small and medium business | Business Central, NAV, RMS

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 2,238

#2
YUN ZHU Profile Picture

YUN ZHU 773 Super User 2025 Season 2

#3
Sumit Singh Profile Picture

Sumit Singh 630

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans