Skip to main content
Post a question

Notifications

Community site session details

Community site session details

Session Id : vcj+O29Xw5Rr2xlFbl9jmK
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

Like (5) ShareShare
ReportReport
Posted on 28 Mar 2025 13:20:40 by 208
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?
 
 
  • Suggested answer
    CU12071344-1 Profile Picture
    8 on 29 Mar 2025 at 19:20:45
    "The request was blocked by the runtime" Error When Sending Sales Invoices to API in BC Cloud
    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

  • Ramesh Kumar Profile Picture
    1,991 on 29 Mar 2025 at 18:48:43
    "The request was blocked by the runtime" Error When Sending Sales Invoices to API in BC Cloud
  • Suggested answer
    Khushbu Rajvi. Profile Picture
    12,116 Super User 2025 Season 1 on 29 Mar 2025 at 05:54:59
    "The request was blocked by the runtime" Error When Sending Sales Invoices to API in BC Cloud
  • CU09091051-0 Profile Picture
    208 on 28 Mar 2025 at 22:57:26
    "The request was blocked by the runtime" Error When Sending Sales Invoices to API in BC Cloud

    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.

     

     

  • Verified answer
    gdrenteria Profile Picture
    16,367 Most Valuable Professional on 28 Mar 2025 at 13:48:01
    "The request was blocked by the runtime" Error When Sending Sales Invoices to API in BC Cloud

    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

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

🌸 Community Spring Festival 2025 Challenge 🌸

WIN Power Platform Community Conference 2025 tickets!

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Kudos to the February Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 293,333 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 232,262 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,158 Moderator

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans
Loading started
Loading complete