Hello,
I've got a database action button (Authorize and Mail) that needs to be hidden if the employee's name is not included in the Expert field. This has been working without issue for the last 10+ years since only 1 person's name was entered in the field. Recently up to 3 names are now being included in the Expert field. I've been told that only the first person named in the field can see the Authorize and Mail button. The hide when code reads:
@UserName != expert
I can't create a Role for expert since a different expert is named to each document. Can anyone advise what I am missing?
Thank you.
Anita
Hello Anita,
Please try @Contains in Formula language:
https://help.hcl-software.com/dom_designer/14.0.0/basic/H_CONTAINS.html
It determines whether a substring is stored within a string, or a item in a list.
For example, kindly see #3 as example in the above link. To apply:
@If(@Contains(@UserName;expert);0;1);
0 means to unhide, 1 means to hide. It can handle non case-sensitive characters.
Hope this helps.
Thanks,
Jayve
Hi Anita,
You can use the @IsMember formula to check if the current user is in the expert field. Here's an example:
@IsMember(@UserName;Expert)
This example returns 1 if user is in the list in the Expert field, returns 0 if user is not in the list.
Here's the documentation for reference.
@IsMember (Formula Language) (hcl-software.com)
@UserName (Formula Language) (hcl-software.com)
Best Regards,
Jho Ann Leanne Labayani
Technical Support - Application Development Team
HCL Technologies
Hello Jho Ann,
I've modified the hide when code to now read:
!@IsMember(@UserName;Expert)
I am waiting on the Engineer to create a new document to test if the button hide does work. I'll follow up once he completes the test.
Thank you!
Anita
@username!=expert, checks for equality… and the expert usename goes in the expert field… expert field was possibly not a multi value field earlier, now it should be multi value field… pl check if it is multivalue field indeed… else it is treated as string …
Now if it is a mult value field… @username=expert should actually check compare @username with multiple values in expert field… so NOT @Username=expert should work if allow multiple values is checked for expert field…
@Username!=expert wont compare with all values.
So Hide:=@if(@username=expert:“no”;“yes”);
Hide=“yes”… or some eqvlnt formula should work… @contains and @ismember is also am option…
Hope it helps
Hello Rajneesh,
The field was initially set to Allow Multiple Values. I've modified the hide when based on Jho Ann's earlier suggestion.
!@IsMember(@UserName;Expert)
I'm waiting for a new document to be created by the Engineering group to verify this change does work. I'll post results.
Thank you for your time.
Anita