SendAsyncWebRequest vs SendWebRequest
Paul Timms
4-4-25
Operating system: macOS
SendWebRequest3 is a boolean function, so if this returns true and the reply header has an accepted status, you can assume that the data was sent successfully and perform some actions on the record that was sent, for example to update a "Sent" status.

SendAsyncWebRequest is a procedure. It receives the reply and reply header into a different "callback" procedure which is entirely disconnected from the previous chain. So, although you can confirm in this callback procedure that the data was accepted, how can you then return this information back to the record in order to update the "Sent" status, if the reply does not contain any useful information?
This answer was correct
Created byDavid Delač08:14 17 Apr 2025
Hello Paul!

You can make use of transactions variables to store record number once you've received expected reply.

Function / Procedure that is calling SendAsyncWebRequest should have transaction variable that you will populate with value that you can use to find your record. Once you declare transaction variable in your reply function, it will automatically contain the value previously set and you can use it.

eg.

transaction string 255 gCUCode;
gCUCode = "TEST";
SendAsyncWebRequest(...,"CallbackFunc",30);


global
procedure CallbackFunc(...)
begin
transaction string 255 gCUCode;

//gCUCode would already be "TEST" here as the value of it is stored in RAM globally.

return;
end;

Let me know if this was clear enough or should I give better example.

Best regards,
David D.
This answer was correct
David Delač
4-17-25
Hello Paul!

You can make use of transactions variables to store record number once you've received expected reply.

Function / Procedure that is calling SendAsyncWebRequest should have transaction variable that you will populate with value that you can use to find your record. Once you declare transaction variable in your reply function, it will automatically contain the value previously set and you can use it.

eg.

transaction string 255 gCUCode;
gCUCode = "TEST";
SendAsyncWebRequest(...,"CallbackFunc",30);


global
procedure CallbackFunc(...)
begin
transaction string 255 gCUCode;

//gCUCode would already be "TEST" here as the value of it is stored in RAM globally.

return;
end;

Let me know if this was clear enough or should I give better example.

Best regards,
David D.
Paul Timms
4-23-25
Thanks David! I'll give that a go and confirm if that works.

Paul
View all Questions
Back to the list
Latest Posts
Arzu Erdogdu
Hello! You can mark it as closed as option. If document is connected with other documents you can not delete it so you will not be able to delete PO, as you will not be able to remove Goods receipt...
09:29 13 Jun 2025
Paul Timms
Hi Yavuz The Services Cache register is stored on the server. Our customer servers are either Linux or Windows. The client OS is irrelevant. Thanks Paul...
14:44 10 Jun 2025