NetTalk Central

Author Topic: Call Form with no browse from Static Page Link  (Read 3783 times)

springguy

  • Full Member
  • ***
  • Posts: 195
    • View Profile
    • Email
Call Form with no browse from Static Page Link
« on: May 07, 2014, 04:14:59 AM »
I have a static page with a link on it to call a Form without a browse.  The background on this is people log in to the system, and a static page (a NetWebPage) with a lot of icon links are on it.  When the click on a particular icon, a call is made to a NT procedure.  That all works fine, but now, I need to add a call to a Form (without a browse) that displays the logged in person's info.
 
I am using the following code in the static call:
 
<a href="'MyChurchProfile?change+btn=change&_bidv_=' &p_web.AddBrowseValue('dmemain','Family',FAM:Key_SysID,60)">
 
MyChurchProfile is the NT Form procedure
I only allow a Change action
The calling static page (which is a NetPage procedure) is dmemain
Family is the table name that contains the logged in person's data
FAM:Key_SysID is the unique key
60 is the person's record key value
 
This call results in a page not found with the following displayed as the link:
 
http://127.0.0.1/'MyChurchProfile?change+btn=change&_bidv_='&p_web.AddBrowseValue( 'dmemain','Family',FAM:Key_SysID,60)
 
I'm guessing the problem is that the instructions in the NetTalk book are not based on the URL being coded in a static link and the " and ' in the link may be a problem.
 
So, two questions:
1. Can I call the form directly from a static link, and if so, what changes do I need to make to the static link?
 
2. Regarding the specific record ID, in the example here I have "hard coded" the ID (60) for testing.  In actual practice, I would have the ID in a session value.  What should the static link change to for using the session value as the source of the record ID?  Replace the example 60 value with p_web.GSV('LoggedInFamilyID')?
 
Thanks for your help on this.
Mike Springer

Rene Simons

  • Hero Member
  • *****
  • Posts: 650
    • View Profile
Re: Call Form with no browse from Static Page Link
« Reply #1 on: May 07, 2014, 05:07:40 AM »
Hi Mike,

If I'm right here,  I see that you try to call a method in the p_web object from a static page,
I don't think that is possible,
The link information has to be ready for use when you call a form from a static page.
The moment you send the page to the browser, the info has to be there.

I haven'tried id it before but maybe a <!--Net:something:Procedure?data=yourdata> is better here.
Look in "The Book" how to call NT forms and browses from a static page.

Cheers,
Rene
Rene Simons
NT14.14

debzidoodle

  • Jr. Member
  • **
  • Posts: 98
    • View Profile
    • Email
Re: Call Form with no browse from Static Page Link
« Reply #2 on: May 07, 2014, 05:20:41 AM »
I think you have your quotes in the wrong spots.  Try it like this.
I removed the ' from
Quote
<a href="'My
and added a &' to this
Quote
SysID,60)">

'<a href="MyChurchProfile?change+btn=change&_bidv_=' &p_web.AddBrowseValue('dmemain','Family',FAM:Key_SysID,60)&'">'

Hope that helps

Debra

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: Call Form with no browse from Static Page Link
« Reply #3 on: May 07, 2014, 05:38:15 AM »
The link is going to be a problem, but let's start at the beginning;

>> This call results in a page not found

This means the PAGE was not found. Whether or not the parameters are correct or not (and clearly, they're not) the first item of business is to get it to find the right page.

>> the following displayed as the link:
>> http://127.0.0.1/'MyChurchProfile?change+btn=change...

For starters there should be no ' in the link. So it should be
http://127.0.0.1/MyChurchProfile
or more commonly (if the link is to the same domain) just
MyChurchProfile

After you've got that sorted you can then start worrying about the parameters.

>> I need to add a call to a Form (without a browse) that displays the logged in person's info.

maybe you don't need parameters at all. The Form (Advanced Tab) let's you set the default action, and the default record. So, it would seem to me that setting the values there would be better than passing them as a parameter.

cheers
Bruce



springguy

  • Full Member
  • ***
  • Posts: 195
    • View Profile
    • Email
Re: Call Form with no browse from Static Page Link
« Reply #4 on: May 07, 2014, 07:38:47 AM »
Bruce,
Thanks for the info.  I changed the static link to simply:   <a href="MyChurchProfile">

Then, in the form's Advanced Tab, I selected the Change action, and put the following in the Key Field 1 Value entry:

p_web.GSV('LoggedInFamilySysID')   where LoggedInFamilySysID was set when the person logged in.

And, just as you predicted, it works perfectly!
Once again, your direction was spot on!
Thanks