NetTalk Central

Author Topic: Call form from Browse  (Read 4147 times)

Bill Quesse

  • Newbie
  • *
  • Posts: 14
    • View Profile
    • Email
Call form from Browse
« on: November 10, 2010, 06:40:13 AM »
I have three tables (Systems -->> EventDetail << -- Events)

On the Systems form I have a browse for EventDetail.  I want the form for the EventDetail browse to edit the record from Events.  (EventDetail contains only the SystemID and the EventID )

I have done this before, with help from Bruce, but can not get it to work this time.

On the form tab of the EventDetail browse I do not specify a form procedure, but have entered a manual URL.



I have tried :
'UpdateEvents?Event:SysID=' & p_web.GSV('EventD:EventID') & '&change_btn=change'
Returns
UpdateEvents?Event:SysID=&change_btn=change

'UpdateEvents?Event:SysID=' & p_web.GetValue('EventD:EventID') & '&change_btn=change'
Returns
UpdateEvents?Event:SysID=&change_btn=change

'UpdateEvents?Event:SysID=' & EventD:EventID & '&change_btn=change'
Returns
UpdateEvents?Event:SysID=0&change_btn=change



For each variation I get the Update form with a record not found error.

If I enter:
 UpdateEvents?Event:SysID=84&change_btn=change
in as the URL in FireFox it works.

(EventD:EventID is shown in the browse and should be available)

What am I doing wrong?

Bill Quesse

Rob Mikkelsen

  • Full Member
  • ***
  • Posts: 107
    • Yahoo Instant Messenger - flashpott
    • View Profile
    • Email
Re: Call form from Browse
« Reply #1 on: November 10, 2010, 04:52:29 PM »
Bill,

It appears that EventD:EventId is not being set as a session variable which accounts for the blank string being returned in your example.  The first line of your example:

'UpdateEvents?Event:SysID=' & p_web.GSV('EventD:EventID') & '&change_btn=change'

appears to be the correct call.  Remember, there is no syntax checking on the variable save, so if you saved it as p_Web.SSV('EventID:EventId') then read it as EventD:EventID then it would return the null string since the variable cannot be found - kind of like using intrinsic variables - exceedingly easy to fall prey to a typing error. 

What I do sometimes is to define it as a local variable, select it from the data table, and put quotes around it in the SSV and GSV statements.  That ensures that I always use the same variable name.

I suggest putting a couple debugview calls or STOP() statements in the code using "cut and paste" to put the same code in there (i.e., STOP(p_Web.GSV('EventD:EventId')) - one where you save the variable and one when you reload it to make sure that a) the value is being saved and b) you are using the same name.

Cheers!

Rob Mikkelsen

Bill Quesse

  • Newbie
  • *
  • Posts: 14
    • View Profile
    • Email
Re: Call form from Browse
« Reply #2 on: November 10, 2010, 06:52:11 PM »
Rob,

Thanks for the reply.

I agree the p_web.GSV('EventD:EventID') should return the correct value.

I have tested in the 'User clicked on a row in the browse' embed and the p_web.GSV('EventD:EventID') returns null.

Bill
Bill Quesse

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11251
    • View Profile
Re: Call form from Browse
« Reply #3 on: November 10, 2010, 10:55:31 PM »
Is your change button "in row" or under the browse?
The "in row" one should work, using the URL
'UpdateEvents?Event:SysID=' & EventD:EventID & '&change_btn=change'

Cheers
Bruce


Bill Quesse

  • Newbie
  • *
  • Posts: 14
    • View Profile
    • Email
Re: Call form from Browse
« Reply #4 on: November 11, 2010, 07:51:18 AM »
Thanks Bruce.  I did get it working.

I had the button in the row, set to 'change' and put the URL in on the button's Hyperlink tab.  This just called the BrowseEvents procedure again.

I changed the button's type to 'Other' which gave me the option to add the URL on the button's properties tab.  This worked.

Is this the correct way?
Bill Quesse

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11251
    • View Profile
Re: Call form from Browse
« Reply #5 on: November 12, 2010, 03:37:12 AM »
yes