Page 1 of 1

Hide an event based on an event field

PostPosted: Mon Nov 08, 2021 4:33 pm
by Jim2001
I thought I knew how to achieve this, but I want to have an event hide on the calendar based on an entry in an event field. Can you point me in the right direction? :roll:

Re: Hide an event based on an event field

PostPosted: Tue Nov 09, 2021 9:42 am
by kcembrey
Hi Jim,

We have some documentation here which describes how to modify the Event Find script to hard-code a filter based on any criteria that you'd like in the event: https://www.seedcode.com/pmwiki/index.p ... eeMyEvents

Another way to do this would be to just have the start date in the "DBk_WebViewerSource" calculation return an empty value based on your special event field. If there's no start date in this calculation, it won't show on the calendar.

I hope that helps! Let us know if you have any further questions.

KC

Re: Hide an event based on an event field

PostPosted: Wed Nov 17, 2021 12:56 pm
by Jim2001
Thanks KC. I set up an 'IF' statement around the "DBk_WebViewerSource" that looks for the event field I made that toggles visibility (a text field with a dropdown). When I enter the event and change this field to hide and save and close the event, it hides just fine. However if I click the refresh or do anything to change the date being viewed it becomes visible again. Any thoughts?

There is just one thing: I have a global variable ($$hideOption) that sets within the calendar file that is used in the IF statement. Now that I look at this it may be that variable is not staying set. Checking...

Re: Hide an event based on an event field

PostPosted: Wed Nov 17, 2021 1:17 pm
by kcembrey
Hi Jim,

Somehow, when DayBack queries the data, the DBk_WebViewerSource calculation is coming back with data, rather than returning an empty string. This could possibly have to do with PSOS.

Are you relying on a global variable to determine whether or not to show the event? If so, keep in mind that PSOS runs in an entirely different session, so that variable won't exist in the PSOS session when the data is queried.

You could instead use a field that isn't stored globally, then it will be unique per record.

Regards,

KC

Re: Hide an event based on an event field

PostPosted: Wed Nov 17, 2021 1:20 pm
by Jim2001
I think you are correct. The global variable is the issue. I forgot about PSOS.