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!!