Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello,
I have a selection trigger on a field EXAMPLE_FIELD which sets the field value to a specific value depending on the current login.
E.g.: User A logs in and get EXAMPLE_FIELD = 1
User B logs in and get EXAMPLE_FIELD = 2
This ensures that the current user can't leave the selection on EXAMPLE_FIELD because everytime they try to change it it changes back to the configured one.
I'm doing this with multiple if statements as shown below:
SET exampleFieldValue =
if(OSUser()='db\526','1', // User A
if(OSUser()='db\534','2', // User B
'*'));
The code sets the selection of EXAMPLE_FIELD depending on the current user. If User C logs in, they get the selection * so everything is selected.
My Problem: Now I want every other user than A and B to freely chose the selection. The code above sets the selection always back to ALL SELECT because of the *.
Is there a possibility to not change the current selection on the last else statement?
So if User C selects 3 in EXAMPLE_FIELD it will remain on 3?
Hope someone knows how to solve this problem.
Thanks
Are you trying to stop user A and B from selecting other values and allow any selection for C? If so, try like:
if(OSUser()='db\526','1', // User A
if(OSUser()='db\534','2', // User B
'('&GetfieldSelections(EXAMPLE_FIELD, '|')&')'
));
Have you tried removing the '*' and leaving it as ''?
Try just removing the else part '*', like:
if(OSUser()='db\526','1', // User A
if(OSUser()='db\534','2' // User B
));
This is not working too. It counts as an empty selection then.
So if you select '1' in EXAMPLE_FIELD the selection gets cleared instantly.
Are you trying to stop user A and B from selecting other values and allow any selection for C? If so, try like:
if(OSUser()='db\526','1', // User A
if(OSUser()='db\534','2', // User B
'('&GetfieldSelections(EXAMPLE_FIELD, '|')&')'
));
Yes this does not work too.
The selection gets cleared after selection a value
// EDIT //
I now tried to put in getfieldselections(EXAMPLE_FIELD) as last else statement.
This works if just one value is selected in the listbox. If I select multiple values it jumps back to a cleared selection.
Any idea on how to get this working with multiple selections in the listbox?
This works!
Thank you so much !