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
Hi there, We have noticed that when we click the "Standard ERP by HansaWorld" logo on the bottom left hand side of the main navigation window that it takes us off to our default browser a...
11:37 14 Aug 2026
Reino Botha
Hi Kevin, All users require a mailbox, including Global Users. The mailbox is also required to enable access to the Personal Desktop, so it cannot be avoided even if the Email and Conference mod...
10:45 14 Aug 2026