0 votes

I've got my own view CUSTOM_R_CHECKAGENDA

I would like to join this view in the sys_query for the Agenda 35,1 35,2 and 35,3. The join would be on K_ACTION. How to solve this? Below the current sys_query 35,1.

My final goal is to change the agenda-colors based on the value in a new field in the custom view.

[Select]
ACTIONS.K_ACTION
ACTIONS.DONE
ACTIONS.D_BEGIN
ACTIONS.D_END
ACTIONS.SUBJECT
ACTIONS.D_CHANGE
ACTIONS.MODE
ACTIONS.NATURE
ACTIONS.TRAVELBEFORE
ACTIONS.TRAVELAFTER
ACTIONS.TIMEZONE
ACTIONS.TIMEZONE [TZMODIFIED]
ACTIONS.LOCATION
ACTIONS.USERS
ACTIONS.ALLDAYEVENT
ACTIONS.F_ACTIVITEIT nolookup
ACTIONS.F_DUBBEL nolookup
ACTIONS.F_BM nolookup
ACTI_USER.ISAGENDA hidden
ACC_GROUPS.K_USER2 hidden
ACTI_USER.P_D_END hidden
ACTI_USER.P_D_BEGIN hidden

[From]
ACTI_USER
ACC_GROUPS
ACTIONS


[Where]
ACTI_USER.ISAGENDA = '1' [fixed]
ACC_GROUPS.K_USER2 in 0
ACTI_USER.P_D_BEGIN < "01/01/1970"
ACTI_USER.P_D_END >= "01/01/1970" 
<#SkipAppendSecurityClause>

[Orderby]

[Options]
Distinct=1
asked in Partners by (210 points)
edited by

1 Answer

0 votes
Best answer

It will be easier to work with a custom SQL function compared to a custom view. Efficy supports binding a field to a custom database function. This technique is also used for the standard fields USERS.

The parameter of your SQL Function should be the K_ACTION. The function can return a number or text value.

Joining with a custom view will require quite some extensions to the dictionary tables. You don't want to go that far...

answered by (6.9k points)
selected by
Thanks! Works perfectly. I created a new function CUSTOM_fnAgendaStatus and retrieve the value 0 or 1 depending on the result of the query.
That was fast!
Welcome to Efficy Overflow, where you can ask questions and receive answers from other members of the community.
1,169 questions
1,427 answers
1,718 comments
325 users