NetTalk Central

Author Topic: call a form programmatically  (Read 3789 times)

bergsj

  • Jr. Member
  • **
  • Posts: 81
    • MSN Messenger - swjvandenberg@hotmail.com
    • View Profile
    • Email
call a form programmatically
« on: September 22, 2009, 02:30:32 AM »
Hi,
I have a button with code in the embed (CustomValidateEnd). After running this code I want to open a form with parameters automatically. How can I do this?
Greetz,
Sjoerd

Mike Grigsby

  • Sr. Member
  • ****
  • Posts: 380
    • Yahoo Instant Messenger - onthedotsoftware
    • View Profile
    • MyHomeAssets! Software (among others)
Re: call a form programmatically
« Reply #1 on: September 22, 2009, 07:19:38 AM »
There are a number of ways to do this, but none that allow you to say "run the code then jump to pagex". If you can put the code in the page you want to jump to, then use the page as the destination for that button, that is ideal. One example included with NTWS that may help is the ProcessUser proc in the Accounts and other examples, where you login, and the system processes the user, then redirects based on the outcome.
Mike Grigsby
Credify Systems
Central Oregon, USA

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: call a form programmatically
« Reply #2 on: September 23, 2009, 12:27:48 AM »
Hi Sjoerd,

tell us more about your situation.
Is the button on a browse or form?
Is it added as a "other" button in a browse row, or as a form field on the form?

Or are you wanting to change some aspect of, say, the Save button on a form?

Cheers
Bruce


bergsj

  • Jr. Member
  • **
  • Posts: 81
    • MSN Messenger - swjvandenberg@hotmail.com
    • View Profile
    • Email
Re: call a form programmatically
« Reply #3 on: September 23, 2009, 04:17:43 AM »
Bruce,

I have the following scenario:

There is a browse where I have al lot of OTHER buttons per row. I would like to have those buttons only once beneath the browse. Since there is no way to put custom buttons beneath a browse, I have put the browse on a form and after the browse I added a button.
When I click on this button I would like to open a custom form 'frmTest?bla__ID=&' & p_web.GSV('browse:ID'). This ID cannot be static on the form since the session value changes when a row is clicked, so it has to be done inside an embed (server-side). Not client-side.

Am I making any sense? ;)
Greetz
Sjoerd
Greetz,
Sjoerd

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: call a form programmatically
« Reply #4 on: September 23, 2009, 07:06:48 AM »
sure,
so when the browse is clicked, the other form field is updated.

Set the button code to use the session value of the browse Id field.

Then in the form go to the browse field, go to the client side tab, and set the buttons to be "reset" when the browse is changed.

resetting a field on a form, from the client side tab, is the same for all form fields, including browses.

cheers
Bruce