I want to call an external webhook whenever certain tables are updated. I have a codeunit which does this, and mostly works. The code looks like:
A variable named "remote" which is of type DotNet, subtype System.Net.HttpHttpClient
function webhook
remote := remote.HttpClient();
remote.GetAsync('
http://www.somecompany.com/webhook?param=foo&other=bar').Wait;
remote.Dispose();
This is then called in the OnModify trigger on a number of tables. Item, Stockkeeping Unit, Customer, etc.
The problem is when the webhook is down. The call hangs then gives an error. This keeps people from editing records when the webhook is down.
Is there any way to catch the error or tell the HttpClient to ignore problems?
Thank you!
Dave
Comments
You can have all the editing logged in the Integration Record and then use NAS to update the web using the Integration Record.
Gunnar Gestsson
Microsoft Certified IT Professional
Dynamics NAV MVP
http://www.dynamics.is
http://Objects4NAV.com
Gunnar Gestsson
Microsoft Certified IT Professional
Dynamics NAV MVP
http://www.dynamics.is
http://Objects4NAV.com
something like integration record and asynch processing in separate process is one way.
If you accept the web hook not to be triggered for 100% then I believe that you may trigger the operation asynchronously and ignore the result (basically without Wait).
Regards, Igor