Hello,
I am trying to use sc_select_where(add) to filter calendar records based on the user that is logged in.
I tried the code below on onCalendarApplicationInit, onApplicationInit, onCalendarScriptInit, onScriptInit:
if([usr_login] != “john”)
{
sc_select_where(add)=“where class = ‘N’”;
}
else
{
//do nothing
}
The code is intended to show only records in which the field class is ‘N’ when the user is not john.
On the other hand, if the logged user is john, he will see records in which the field class is ‘N’ or ‘Y’.
In all events mentioned above (onCalendarApplicationInit, onApplicationInit, onCalendarScriptInit, onScriptInit), the code does not work and the records on calendar are not filtered as expected.
I can’t figure out my mistake. I appreciate for any help.
Thanks.
Daniel.