Peter,
A couple of thoughts.
On Thu, May 11, 2017 at 11:05 AM, Peter Mew via 4D_Tech <
[email protected]> wrote:
> Hi
> I have a form with 4 pages.
> each page has a button to create a new record.
> Each button also does some slightly different stuff depending which page
> its on.
> Which is why there is a button on each page, rather than a single button on
> Page 0
>
This is actually my preferred approach. Set the button object to only
respond to On click. The method looks something like:
Case of
:(Form current page = 1)
...
:(Form current page = 2)
...
:(Form current page = 3)
...
:(Form current page = 4)
...
End case
It's better to have fewer instances of code than more and this way you
have one script to maintain instead of 4. And if you have to add page 5
it's easier.
All the buttons have the variable name bNewRecord.
>
What's the benefit of having a process variable associated with the button
at all? It's really not necessary any more.
If you do actually need it I'd use the approach above. But in general I'd
just eliminate the process var and simply work with the object name. If
you're insistent on separate objects on each page you can name the object
"btn_new_pg1", ...
> My question is:
> If I click the button on page 1, will the scripts under the buttons on
> pages 2,3 & 4 run as well.
>
No.
--
Kirk Brooks
San Francisco, CA
=======================
*The only thing necessary for the triumph of evil is for good men to do
nothing.*
*- Edmund Burke*
**********************************************************************
4D Internet Users Group (4D iNUG)
FAQ: http://lists.4d.com/faqnug.html
Archive: http://lists.4d.com/archives.html
Options: http://lists.4d.com/mailman/options/4d_tech
Unsub: mailto:[email protected]
**********************************************************************