NetTalk Central
NetTalk Web Server => Web Server - Ask For Help => Topic started by: Johan van Zyl 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!
-
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
-
Thx! Will try that now!
-
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.
-
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
-
Hey, thx man!
-
The very first entry in mx_server is
Referer: http://localhost/CalendarBookingsLocums?_bidv_=atJkHAyd&peopleguid=&PressedButton=
-
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.
-
Right on - thx so far - will keep posting here if required and you can attend to it when convenient!!
-
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.
-
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
-
Yikes, it is working! Thank you so much, you saved my life and my sanity!!!
-
Cool!