NetTalk Central

Author Topic: Calling a source procedure from a button on a memory form and going to another p  (Read 2758 times)

terryd

  • Hero Member
  • *****
  • Posts: 759
    • View Profile
    • Davcomm
    • Email
Hi Bruce
Following up from the question I asked in the webinar last night.
I have placed the call to the TagTransfer source procedure in the Validate::TagTransferButton Routine Add serverside code here and the procedure gets called correctly.
The serverside code is called 3 times, once when the form generates the button and twice when the button is clicked.
I can live with this but it would be preferable to be able to control when the TagTransfer(p_web) is called.
Secondly I would like to close the form and return to the menu.
In the On Click URL I have entered 'index.htm' which returns me to the menu but doesn't reset the session variable that I would like to reset to 0 i.e. p_web.SSV('StatusID',0). I can't set this in the tagTransfer procedure because of the three calls, the first two of which should not change this variable. Is there a location where I can set this to 0 just before or after the Index.htm operation?
Terry Davidson
Windows 10 64 bit/Windows7 64bit
Clarion 9.1.11529/Clarion10 12567
Nettalk 913
Nettalk 1015
StringTheory267/Winevent515/XFiles298/MessageBox239/Cryptonite186

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Hi Terry,

>> The serverside code is called 3 times, once when the form generates the button and twice when the button is clicked.

then you've done something wrong. The Validate:: routines only get called when the field is completed.

>> Secondly I would like to close the form and return to the menu.

On the same button? On the same click?

Cheers
Bruce

terryd

  • Hero Member
  • *****
  • Posts: 759
    • View Profile
    • Davcomm
    • Email
>> The serverside code is called 3 times, once when the form generates the button and twice when the button is clicked.

then you've done something wrong. The Validate:: routines only get called when the field is completed.

Yes I had the call to the source procedure in 2 different places.

>> Secondly I would like to close the form and return to the menu.

On the same button? On the same click?
Yes on the same button, same OnClick

With the On Click url of 'index.htm' the procedure does go to the menu. I would like to set a session value just before the 'index.htm' is called
Terry Davidson
Windows 10 64 bit/Windows7 64bit
Clarion 9.1.11529/Clarion10 12567
Nettalk 913
Nettalk 1015
StringTheory267/Winevent515/XFiles298/MessageBox239/Cryptonite186

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Terry,

you can't do both.
Probably your best option is to pass a parameter as part of the URL call. Note that the call to index.htm, and the server-side-code can run in either order - you can't predict which one will happen first, because they're running on different threads.

So add a parameter, and do a p_web.StoreValue in the destination procedure.

cheers
Bruce