NetTalk Central

Author Topic: Update code fires on Browse  (Read 3120 times)

John Fligg

  • Sr. Member
  • ****
  • Posts: 361
    • View Profile
    • Ambrit Software
    • Email
Update code fires on Browse
« on: December 31, 2011, 03:44:06 AM »
Should this happen as I think it is key to some issues I am having?

I have code under Procedure Setup on a Contact Form (update).

During testing I now find that when I open the Browse (not the Update form) the Update Form code is being run.

John

ccordes

  • Sr. Member
  • ****
  • Posts: 384
    • View Profile
    • Email
Re: Update code fires on Browse
« Reply #1 on: January 01, 2012, 09:24:24 AM »
I'm not sure what you're doing, but when pages appear that you don't expect to appear, I double check the naming of things.
In NT pages are called 2 ways; by the procedure name and by page name. Procedure names are unique while page names might not be since you enter them in the template.So check what you called the page on the general tab for the procedure. It became such a problem for me that I wrote a quick template utility to find duplicate page names.
Also, if you are doing any sleight of hand stuff in the sendfile method of the workler you may have an issue there.

Happy New Year
HTH
chris
Real programmers use copy con newapp.exe

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11244
    • View Profile
Re: Update code fires on Browse
« Reply #2 on: January 02, 2012, 12:32:04 AM »
Hi John,

>> Should this happen as I think it is key to some issues I am having?

the short answer is yes.

>> I have code under Procedure Setup on a Contact Form (update).

This is almost never a good place to put code, except in very specific circumstances. Putting code here is a sign that you don't yet have a full understanding of the "multi-threaded" nature of these procedures. If you put a trace statement in here you'll see it can be called many many times, and for many different reasons.

What you want to do is narrow down when you want your code to run, and then move it down in the form to that specific point.

<< During testing I now find that when I open the Browse (not the Update form) the Update Form code is being run.

correct. The browse can call the form in a "pre call" so that when the form is required the necessary HTML container for it exists on the page. It can get very technical, but suffice to say this is both expected, and correct.

cheers
Bruce

John Fligg

  • Sr. Member
  • ****
  • Posts: 361
    • View Profile
    • Ambrit Software
    • Email
Re: Update code fires on Browse
« Reply #3 on: January 02, 2012, 12:50:48 AM »
Hi Bruce - thanks and yes I was finally coming to the conclusion that this is the wrong embed point as I had found exactly what you say.

Probably got something to do with my other post about closing a window (that does not exist <g>).

Thanks

John