11
Web Server - Ask For Help / Re: Webhooks in Nettalk?
« Last post by AtoB on September 24, 2026, 11:15:04 PM »Hi Ron,
why: I need to interface (API) with a new transportation system for one of my clients that plans and keeps track of trips/shipments/etc from various parties. This system (by default) sends out lots of data (to our already heavily used api-servers). Their payloads are quite large and most are not necessary for us. We decided a webhook system would be better. Now they just signal to our api-server: trip X has changed or shipment Y has updates and then we just register these events. They send really small payloads and I respond in a couple of milliseconds.
I've got a separate application that processes these webhook events and decides wether they are relevant for our needs (and when they are I fetch the data from their system and process it). Main advantage: I can skip lots of events and always retrieve the most current data/state from this system.
The api-server has (currently) one endpoint (basicly NetWebmethod) that registers the events. It's not entirely finished and needs some polishing on my end but it adheres to some standards and the article prevented me from making stupid mistakes (which there probably are still some in this system :-))
When it's stable I can post some code snippets so you can get the gist of it if you like to (currently working on the event processing bit and still making changes ...)
Regards,
Ton
why: I need to interface (API) with a new transportation system for one of my clients that plans and keeps track of trips/shipments/etc from various parties. This system (by default) sends out lots of data (to our already heavily used api-servers). Their payloads are quite large and most are not necessary for us. We decided a webhook system would be better. Now they just signal to our api-server: trip X has changed or shipment Y has updates and then we just register these events. They send really small payloads and I respond in a couple of milliseconds.
I've got a separate application that processes these webhook events and decides wether they are relevant for our needs (and when they are I fetch the data from their system and process it). Main advantage: I can skip lots of events and always retrieve the most current data/state from this system.
The api-server has (currently) one endpoint (basicly NetWebmethod) that registers the events. It's not entirely finished and needs some polishing on my end but it adheres to some standards and the article prevented me from making stupid mistakes (which there probably are still some in this system :-))
When it's stable I can post some code snippets so you can get the gist of it if you like to (currently working on the event processing bit and still making changes ...)
Regards,
Ton
12
Web Server - Ask For Help / Re: Index Page has losts its menu
« Last post by Richard I on September 24, 2026, 08:59:06 PM »Hi Ron,
Ive got it back thanks
I was calling the login form first instead of the Index Page....where prviously I was calling the login form FROM the Index page....
So all good now, almost !
Cheers
Richard
Ive got it back thanks
I was calling the login form first instead of the Index Page....where prviously I was calling the login form FROM the Index page....
So all good now, almost !
Cheers
Richard
13
Web Server - Ask For Help / Re: Webhooks in Nettalk?
« Last post by rjolda on September 24, 2026, 03:15:12 PM »HI Ton,
Very interesting article. Perhaps you might want to share how you use webhooks in NetTalk and why.
Thanks,
Ron
Very interesting article. Perhaps you might want to share how you use webhooks in NetTalk and why.
Thanks,
Ron
14
Web Server - Ask For Help / Re: How to execute code once of Form Load?
« Last post by rjolda on September 24, 2026, 12:48:58 PM »Hi Johan,
I wanted to capture the last SAVE to File event and run code there. I put an embed there and traced the stage each time that it ran and I found that p_stage=65536 was the embed point at the very end. I put code there and it only runs ONCE. So, I would suggest you place a debug trace on the embed you want and see what stage it runs at and see if you can isolate a stage (by number) that runs only ONCE.
I am not sure that it is best practice but it works ! ( forms can get called many times as the web server services other calls and keeps coming back to the open form for that user)
Ron
I wanted to capture the last SAVE to File event and run code there. I put an embed there and traced the stage each time that it ran and I found that p_stage=65536 was the embed point at the very end. I put code there and it only runs ONCE. So, I would suggest you place a debug trace on the embed you want and see what stage it runs at and see if you can isolate a stage (by number) that runs only ONCE.
I am not sure that it is best practice but it works ! ( forms can get called many times as the web server services other calls and keeps coming back to the open form for that user)
Ron
15
Web Server - Ask For Help / Re: Index Page has losts its menu
« Last post by rjolda on September 24, 2026, 12:36:54 PM »HI Richard,
I have had the menu go wonky several times. I use a double drop menu. Sometimes after editing a menu item, it goes wonky and goes to Task Panel or Accordion and is half missing. So, I would check that first.
Ron
I have had the menu go wonky several times. I use a double drop menu. Sometimes after editing a menu item, it goes wonky and goes to Task Panel or Accordion and is half missing. So, I would check that first.
Ron
16
Web Server - Ask For Help / Index Page has losts its menu
« Last post by Richard I on September 24, 2026, 03:41:48 AM »Please tell me how I can restore the Menu to visible view in my PageHeaderTag
Everything looks ok in there.
I dont know why or how it fell off other than I have been playing with Themes syles and scripts...
Thanks
Richard
C12.4000 NT 14
Everything looks ok in there.
I dont know why or how it fell off other than I have been playing with Themes syles and scripts...
Thanks
Richard
C12.4000 NT 14
17
Web Server - Ask For Help / How to execute code once on Form Load?
« Last post by JohanR on September 24, 2026, 02:43:47 AM »Hi,
What is the preferred method or embed to ensure code only runs once on form generation, popup or page loaded.
I am currently using
if (p_web.GetValue('SignInResetPassword_form:inited_') = 1)
Using code below, it runs through twice, even if checking on p_web.SetValue('SignInResetPassword_form:inited_',1)
Attached code and debuglog for initform and preupdate code/logs
thanks for any advice
Johan
InitForm Routine
DATA
LF &FILE
! Start of "Initalize the Form before anything else is done"
! [Priority 5000]
! End of "Initalize the Form before anything else is done"
CODE
! Start of "Initalize the Form before anything else is done"
! [Priority 5000]
ds_OutputDebugString('>>> InitForm <<<' & format(clock(),@t06))
if (p_web.GetValue('SignInResetPassword_form:inited_') = 1)
ds_OutputDebugString('========== 2nd time' & format(clock(),@t06))
else
ds_OutputDebugString('========== 1st time' & format(clock(),@t06))
end
! End of "Initalize the Form before anything else is done"
p_web.SetValue('SignInResetPassword_form:inited_',1)
p_web.formsettings.file = ''
p_web.formsettings.key = ''
do RestoreMem
! Start of "Initalize the Form before anything else is done"
! [Priority 5000]
What is the preferred method or embed to ensure code only runs once on form generation, popup or page loaded.
I am currently using
if (p_web.GetValue('SignInResetPassword_form:inited_') = 1)
Using code below, it runs through twice, even if checking on p_web.SetValue('SignInResetPassword_form:inited_',1)
Attached code and debuglog for initform and preupdate code/logs
thanks for any advice
Johan
InitForm Routine
DATA
LF &FILE
! Start of "Initalize the Form before anything else is done"
! [Priority 5000]
! End of "Initalize the Form before anything else is done"
CODE
! Start of "Initalize the Form before anything else is done"
! [Priority 5000]
ds_OutputDebugString('>>> InitForm <<<' & format(clock(),@t06))
if (p_web.GetValue('SignInResetPassword_form:inited_') = 1)
ds_OutputDebugString('========== 2nd time' & format(clock(),@t06))
else
ds_OutputDebugString('========== 1st time' & format(clock(),@t06))
end
! End of "Initalize the Form before anything else is done"
p_web.SetValue('SignInResetPassword_form:inited_',1)
p_web.formsettings.file = ''
p_web.formsettings.key = ''
do RestoreMem
! Start of "Initalize the Form before anything else is done"
! [Priority 5000]
18
Web Server - Ask For Help / Re: Webhooks in Nettalk?
« Last post by AtoB on September 24, 2026, 01:11:16 AM »Been working on this (quite a bit of work actually), but for anyone interested, I think this is a really good resource : https://webhooker.eu/blog.
Also there are services that (like this webhooker) take care of the pesky details
Also there are services that (like this webhooker) take care of the pesky details
19
Web Server - Ask For Help / Re: Custom response headers
« Last post by the_question on September 23, 2026, 01:45:10 AM »This is inside NetWebHandleRequest:
Code: [Select]
p_web.CreateHeader PROCEDURE(NetWebServerHeaderDetailsType p_HeaderDetails)
ReturnValue ANY
! Start of "NetTalk Method Data Section"
! [Priority 5000]
! End of "NetTalk Method Data Section"
CODE
! Start of "NetTalk Method Executable Code Section"
! [Priority 2500]
p_HeaderDetails.CustomHeader = CLIP(p_HeaderDetails.CustomHeader) & |
'<13,10>Cross-Origin-Opener-Policy: same-origin' & |
'<13,10>Cross-Origin-Embedder-Policy: require-corp'
! Parent Call
ReturnValue = PARENT.CreateHeader(p_HeaderDetails)
! [Priority 7500]
! End of "NetTalk Method Executable Code Section"
RETURN ReturnValue
20
Web Server - Ask For Help / Re: Custom response headers
« Last post by Bruce on September 21, 2026, 01:16:02 PM »show your code, and where it goes.
Recent Posts