NetTalk Central

Author Topic: How do I call Procedure in code  (Read 3852 times)

johanco123

  • Full Member
  • ***
  • Posts: 245
    • View Profile
    • Email
How do I call Procedure in code
« on: October 30, 2013, 05:38:01 AM »
Hi Bruce,

I have a button on a memory form with code behind the button. I want to call tot run a different procedure depending on conditions of selection criteria previously. There will be several conditions like the example for the same button.

   If p_web.GSV('SV_loc:ReportSession')=248 
      p_web.SSV('Value',12)
      ViewProgressPage(p_web)
   END

Normally I could use this in the URL as 'ViewProgressPage?value=12'

How can I do this in the example code above.

Regards
Johan

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: How do I call Procedure in code
« Reply #1 on: October 30, 2013, 05:48:26 AM »
Is ViewProgressPage a NetWebPage?
A page cannot be embedded on another page, so you can't call a page as an ajax reply.

I recommend you move the "common" part of the page into a NetWebSource - then you can call the NetWebSource from the page itself, and also from this part.

I set a value before the call do
p_web.SetValue('value',12)
SomeNetWebSource(p_web)


cheers
Bruce

johanco123

  • Full Member
  • ***
  • Posts: 245
    • View Profile
    • Email
Re: How do I call Procedure in code
« Reply #2 on: October 30, 2013, 09:35:34 PM »
Tanks Bruce

ViewProgressPage is a NetWebPage
I change it to a NetWebSource with the settings above, it is running the process, but it does not display the pdf report.(Open the new PDF window with the report)

Any Suggestions
Tanks
Johan

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: How do I call Procedure in code
« Reply #3 on: October 31, 2013, 01:20:58 AM »
what report? how does a report fit into your netwebsource?
did the browser ask for a report? or did the user just press a button?

johanco123

  • Full Member
  • ***
  • Posts: 245
    • View Profile
    • Email
Re: How do I call Procedure in code
« Reply #4 on: October 31, 2013, 03:01:24 AM »
Hi Bruce

I change to call the netwebsource procedure out of the button procedure and not out of the embedded code. This is working now.

the only problem now is sometimes the report is a long report, then the webpage timeout before the pdf is created.

Any Suggestions

Regards
Johan

urayoan

  • Full Member
  • ***
  • Posts: 222
    • View Profile
    • AZ Rock Radio
Re: How do I call Procedure in code
« Reply #5 on: October 31, 2013, 06:00:31 AM »
johanco, in my case o resolve that problem using a progress bar.

Another function that works is using p_web.noop but visually for the client, the progress bar is helpful let them knows that something is happen behind the scenes.

Cheers