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

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

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

Error In Http Request

(0) ShareShare
ReportReport
Posted on by 2,116

Hi Community!

I have developed a Confirm Dialogue box that pops up when a new record is inserted into the Sales Quote line items. Upon selecting /Yes/, I send an HTTP request to send the Item number in the logic app. While my logic app is working as expected the issue is when I send a second request for a different Item without refreshing the page or closing the sales quote page. In this case, I face the following error, Please refer to the screenprints of the code and error for more details.

CODE:

 

 trigger OnInsertRecord(BelowxRec: Boolean): Boolean

    begin

        DWEFQ.SetRange(NIIN, Rec./No./);

        if not DWEFQ.FindSet() then begin

            if Confirm('Do you wish to include historical data for the Item No %1?', true, Rec./No./) then begin

                //Fetch Selected Record - Item Number

             A_Content := '{ /No./: /' + Rec./No./ + '/ }';

                //Code for the call Logic App on the Action.

                A_HttpContent.WriteFrom(AMS_Content);

                A_HttpContent.GetHeaders(AMS_HttpHeaders);

                A_HttpHeaders.Clear();

                A_HttpHeaders.Add('Content-Type', 'application/Json');

                A_HttpRequestMessage.Content := AMS_HttpContent;

                A_HttpRequestMessage.SetRequestUri('My URL');

                A_HttpRequestMessage.Method := 'post';

                A_HttpClient.Send(AMS_HttpRequestMessage, AMS_HttpResponseMessage);

                A_HttpResponseMessage.Content().ReadAs(responseText);

 

                if not A_HttpResponseMessage.IsSuccessStatusCode() then

                    Message('Sorry! The data was not found for ' + Rec./No./)

                else

                    Message('The data has been received for ' + Rec./No./);

                // A_HttpContent.Clear();

                // A_HttpRequestMessage.Content.Clear();

                // A_HttpResponseMessage.Content.Clear();

                // A_HttpClient.Clear();

            end

            else

                Message('Thank you for confirming.');

        end;

 

Error:

 

 Can anyone give me a solution for this what can I do?

 

Thank you in advance!!

 

I have the same question (0)
  • Judy Profile Picture
    Microsoft Employee on at
    Hi Sir,
     
    Can you please try to clear all the variables (uri, http request, content, headers...) in the beginning of the loop to see if it can help.
     
     
    Best Regards,
    Judy

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Meet the Microsoft Dynamics 365 Contact Center Champions

We are thrilled to have these Champions in our Community!

Congratulations to the April Top 10 Community Leaders

These are the community rock stars!

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

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 2,138 Super User 2026 Season 1

#2
YUN ZHU Profile Picture

YUN ZHU 1,279 Super User 2026 Season 1

#3
AndrewThomas81 Profile Picture

AndrewThomas81 1,192

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans