NetTalk Central

Author Topic: NTWS Buttons on Browse and filter NetWebYear  (Read 7406 times)

Johan van Zyl

  • Full Member
  • ***
  • Posts: 180
  • jvz
    • View Profile
    • Email
NTWS Buttons on Browse and filter NetWebYear
« on: April 03, 2018, 02:46:06 AM »
Hi

http://www.medxinfo.co.za/Browsetpeople
click on Calendar to call www.medxinfo.co.za/CalendarBookingsLocums (CalendarBookingsLocums not on LIVE site yet)
then it must filter CalendarBookingsLocums on tpe:guid

http://www.medxinfo.co.za/CalendarBookings
(at the moment it will only show MY bookings - no filter as yet)

see attached for FILTER on NetWebYear
'UPPER(boo:peopleguid) = ''' & upper(p_web.GSV('tpe:guid')) & ''''
or
'UPPER(boo:peopleguid) = ''' & upper(p_web.GSV('somesessionvariable')) & ''''  ???
which does not work at the moment.

Obviously I must execute  the correct SSV in the Browse - but where - which embed point or otherwise?
And what must the filter look like.

Many thanks - this is a showstopper for me!

« Last Edit: April 03, 2018, 03:34:07 AM by Johan van Zyl »
Johan van Zyl
Clarion 6.3 9058/C8 Gold/SQL/NetTalk WebServer

bshields

  • Sr. Member
  • ****
  • Posts: 392
    • View Profile
    • Inhabit
    • Email
Re: NTWS Buttons on Browse and filter NetWebYear
« Reply #1 on: April 03, 2018, 03:47:14 AM »
Hi Johan,

I'm sort of guessing here.

Looks like you have a button on the browse and you are calling a calendar and trying to pass a value specific to the browse row (eg a guid of the person).


I'd:
1. add a button in browse
2. select action as "other"
3. In OnClick tab, select Procedure "CalendarBookingsLocums"
4. In Parameters add 'guid='&p_web.GSV('tpe:guid')   **TPE:GUID needs to be in the browse or added as a view field, otherwise it will have no value.
5. In the procedure CalendarBookingsLocums you need to check for the guid being passed using

IF p_web.IfExistsValue('guid')=true
  p_web.SSV('CalendarBookingsLocums_TPE_GUID',p_web.GetValue('guid'))
.

I'm not very familiar with the Calendar control, you'll need to add this code in an embed point at the beginning of the procedure.

Edit your filter to look like this:

'UPPER(boo:peopleguid) = ''' & upper(p_web.GSV('CalendarBookingsLocums_TPE_GUID')) & ''''

This should pass the value.

Caveats:
1. You should not pass a guid unobsticated. You should use AddBrowseValue / GetBrowseValue, but once you get this working, you can figure it out later.
2. I have invented this session variable CalendarBookingsLocums_TPE_GUID, you can call it anything you like.

Regards
Bill


Johan van Zyl

  • Full Member
  • ***
  • Posts: 180
  • jvz
    • View Profile
    • Email
Re: NTWS Buttons on Browse and filter NetWebYear
« Reply #2 on: April 03, 2018, 04:07:22 AM »
Thx! Will try that now!
Johan van Zyl
Clarion 6.3 9058/C8 Gold/SQL/NetTalk WebServer

Johan van Zyl

  • Full Member
  • ***
  • Posts: 180
  • jvz
    • View Profile
    • Email
Re: NTWS Buttons on Browse and filter NetWebYear
« Reply #3 on: April 03, 2018, 06:27:54 AM »
Hi


Still no success.
Where do I find AddBrowseValue / GetBrowseValue and what do I put in there?

In  p_web.SSV('CalendarBookingsLocums_TPE_GUID',p_web.GetValue('guid'))
guid is a sessionvariable? Must it have quotes around it?

Where do I put this code (embed)
  IF p_web.IfExistsValue('peopleguid')=true
      p_web.SSV('CalendarBookingsLocums_TPE_GUID',p_web.GetValue('peopleguid'))
      dbvstr.trace('dbv CalendarBookingsLocums '&peopleguid &' '& tpe:name)
  .
And the compiler has a problem with peopleguid inside dbvstr.trace('dbv CalendarBookingsLocums '&peopleguid &' '& tpe:name).
Wrong embed point?
 
I call it peopleguid and not guid, but you get the picture.
« Last Edit: April 03, 2018, 06:38:12 AM by Johan van Zyl »
Johan van Zyl
Clarion 6.3 9058/C8 Gold/SQL/NetTalk WebServer

bshields

  • Sr. Member
  • ****
  • Posts: 392
    • View Profile
    • Inhabit
    • Email
Re: NTWS Buttons on Browse and filter NetWebYear
« Reply #4 on: April 03, 2018, 06:48:45 AM »
Hi Johan,

1. Don't worry about Add/Get BrowseValue yet.

2. GUID is a URL parameter, not session value. It does need ' ' around it. (or peopleguid in your example)

3. Put the code in first embed after CODE in your calendar function (yeap thats a bit crude, but im flying blind here).

4. dbvstr.trace('dbv CalendarBookingsLocums '&peopleguid &' '& tpe:name)

should read

dbvstr.trace('dbv CalendarBookingsLocums '&p_web.GetValue('peopleguid') &' '& tpe:name)

5. Dont forget to change guid into peopleguid in the calendar button function.


To diagnose:

1. click on the calendar button - don't click anything else
2. Go into your server app and look at the top entry in the on screen log, and step backwards until you find "CalendarBookingsLocums?peopleguid=XXX". If its missing the peopleguid= bit, its not working inside the browse, if its there but the value is blank or incorrect the problem is in the browse procedure at p_web.GSV('TPE:GUID') piece of code. If its there and the correct guid is showing, the problem is in the Calendar function and you should diagnose the filter side of things.

Hope that helps.

Regards
Bill
« Last Edit: April 03, 2018, 06:55:32 AM by bshields »

Johan van Zyl

  • Full Member
  • ***
  • Posts: 180
  • jvz
    • View Profile
    • Email
Re: NTWS Buttons on Browse and filter NetWebYear
« Reply #5 on: April 03, 2018, 07:13:43 AM »
Hey, thx man!
Johan van Zyl
Clarion 6.3 9058/C8 Gold/SQL/NetTalk WebServer

Johan van Zyl

  • Full Member
  • ***
  • Posts: 180
  • jvz
    • View Profile
    • Email
Re: NTWS Buttons on Browse and filter NetWebYear
« Reply #6 on: April 03, 2018, 07:28:40 AM »
Johan van Zyl
Clarion 6.3 9058/C8 Gold/SQL/NetTalk WebServer

bshields

  • Sr. Member
  • ****
  • Posts: 392
    • View Profile
    • Inhabit
    • Email
Re: NTWS Buttons on Browse and filter NetWebYear
« Reply #7 on: April 03, 2018, 07:35:51 AM »
Ok thats good. It means the p_web.GSV('TPE:GUID') is not available when the Browse generates.

I made a mistake, you should just use PTE:GUID. When its generating the browse the actual record buffer is available, you dont need to use the session variables (its getting late here).

PTE:GUID will also need to be in the browse or a view field (as i mentioned earlier).

Good luck - i've gotta get some sleep. I'll check in tomorrow.
« Last Edit: April 03, 2018, 07:38:13 AM by bshields »

Johan van Zyl

  • Full Member
  • ***
  • Posts: 180
  • jvz
    • View Profile
    • Email
Re: NTWS Buttons on Browse and filter NetWebYear
« Reply #8 on: April 03, 2018, 07:44:15 AM »
Right on - thx so far - will keep posting here if required and you can attend to it when convenient!!
Johan van Zyl
Clarion 6.3 9058/C8 Gold/SQL/NetTalk WebServer

Johan van Zyl

  • Full Member
  • ***
  • Posts: 180
  • jvz
    • View Profile
    • Email
Re: NTWS Buttons on Browse and filter NetWebYear
« Reply #9 on: April 03, 2018, 10:56:56 PM »
And the battle continues.

OK, parameter in Browsetpeople is
'peopleguid='&p_web.GSV(tpe:guid)
At least something works, to a degree, because peopleguid does appear but no GUID. Referer: http://localhost/CalendarBookingsLocums?_bidv_=0VyI3FW7&peopleguid=&PressedButton=
Is there a problem with the parameter statement?

 And still dont know where to put this code.
See attached embed tree
 IF p_web.IfExistsValue('peopleguid')=true     
        dbvstr.trace('dbv CalendarBookingsLocums '&p_web.SSV('CalendarBookingsLocums_TPE_GUID',p_web.GetValue('peopleguid')) &' '& tpe:name)
    ELSE
     dbvstr.trace('dbv CalendarBookingsLocums IF NOT p_web.IfExistsValue(peopleguid)=true') 
 END
Is the above code indeed correct?

and the current filter on CalendarBookingsLocums is
'UPPER(boo:peopleguid) = ''' & upper(p_web.GSV('CalendarBookingsLocums_TPE_GUID')) & ''''
Is that in fact correct?

After clicking on Calendar Button I get as in other attached file in DebugView++
Well it depends where the embed code is, sometimes nothing happens.

Thx a stack for spending time on this, I REALLY appreciate it!
Answer whenever convenient.




« Last Edit: April 03, 2018, 11:07:42 PM by Johan van Zyl »
Johan van Zyl
Clarion 6.3 9058/C8 Gold/SQL/NetTalk WebServer

bshields

  • Sr. Member
  • ****
  • Posts: 392
    • View Profile
    • Inhabit
    • Email
Re: NTWS Buttons on Browse and filter NetWebYear
« Reply #10 on: April 03, 2018, 11:57:47 PM »
1. change

'peopleguid='&p_web.GSV(tpe:guid)

to

'peopleguid='&tpe:guid

2. Put it back to this

 IF p_web.IfExistsValue('peopleguid')=true
     p_web._Trace('found a peopleguid! '&p_web.GetValue('peopleguid'))
     p_web.SSV('CalendarBookingsLocums_TPE_GUID',p_web.GetValue('peopleguid'))
 END
 p_web._Trace('CalendarBookingsLocums_TPE_GUID = '&p_web.GSV('CalendarBookingsLocums_TPE_GUID'))

3. place it in the "Procedure Setup" (crude but will work)

4. Filter is correct


Johan van Zyl

  • Full Member
  • ***
  • Posts: 180
  • jvz
    • View Profile
    • Email
Re: NTWS Buttons on Browse and filter NetWebYear
« Reply #11 on: April 04, 2018, 12:57:19 AM »
Yikes, it is working! Thank you so much, you saved my life and my sanity!!!
Johan van Zyl
Clarion 6.3 9058/C8 Gold/SQL/NetTalk WebServer

bshields

  • Sr. Member
  • ****
  • Posts: 392
    • View Profile
    • Inhabit
    • Email
Re: NTWS Buttons on Browse and filter NetWebYear
« Reply #12 on: April 04, 2018, 12:59:09 AM »
Cool!