Condition is always on true

Suyash Joshi
Tera Contributor

Hello Everyone,

while creating a UI action I faced an issue with auto generated button when condition is false.
I want to select a caller if the caller is in 'openspace' group UI action button are visible but when I test it and run on other member it still display the button.
Script :  u_caller == gs.getUser().isMemberOf('openspace')
Anyone help me on urgent basis.
Regards,
Suyash

1 ACCEPTED SOLUTION

Anil Lande
Kilo Patron

Hi @Suyash Joshi ,

If your requirement is to show button only when caller is member of 'Openspace' then you can use below in your Ui Action condition:

gs.getUser().­getUserByID(current.caller_id).isMemberOf('Openspace')

 

Replace caller_id field by correct field name as per your requirement (eg. u_caller)

 

Please appreciate the efforts of community contributors by marking appropriate response as correct answer and helpful, this may help other community users to follow correct solution in future.
Thanks
Anil Lande

View solution in original post

17 REPLIES 17

Danish Bhairag2
Tera Sage
Tera Sage

Hi @Suyash Joshi ,

 

Try bu using current

 

current.u_caller == gs.getUser().isMemberOf('openspace');

 

Thanks,

Danish

 

Your script wasn't run when using current.

Harish KM
Kilo Patron
Kilo Patron

Hi @Suyash Joshi your condition should look like this


(gs.getUserID() == current.u_caller) && (gs.getUser().isMemberOf('openspace')) // match loggedin user as caller and logged in user is member of grp

Regards
Harish

Hello @Harish KM your script need some changes
(u_caller.gs.getUserID() == current.u_caller) && (u_caller.gs.getUser().isMemberOf('openspace'))
well it still display button if condition is false