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

No I am not impersonating, I create a field on custom table name-u_caller it is an reference of sys_user table If any user in the openspace group is selected the button are visible but in my case I am generating button without condition on true.

Hi @Suyash Joshi in that case you need just this condition below

gs.getUser().isMemberOf('openspace') // if current logged in user is member of Openspace button will display else it will hide

Regards
Harish

Hey @Harish KM  It doesn't run in this script i add u_caller == //your script then it will visible but problem is that it also display on false condition

Chaitanya naram
Kilo Sage

Hi @Suyash Joshi Please provide clarifications on below.
1) On which table you have written the UI Action?
2) Would you like to show the UI Action only when you selected the caller (caller should not be empty) and caller is logged in user & part of Openspace group?

3) And now you are saying that the button is visible even you changed the caller (different from logged in user and not part of Openspace group) and save the record?

 

 

 

Thanks & Regards | Chiranjeevi Chaitanya Naram
Kindly mark the answer Correct and Helpful if it helps to resolve your issue.

Hello @Chaitanya naram 
Firstly I created a custom table and create a reference field u_caller the table reference is sys_user after that if any user is select and it is user of openspace group it will display button but in my case even my condition are false it is visible and I also use gs.addInfoMessage to check my condition is running or not.