Highlighted
Absent Member.. Ceratophora Absent Member..
Absent Member..
1039 views

Application Designer button Relevance Script CurrentUser

Jump to solution

Hello there,

 

I want to make the delete button in a view visible to some user roles and invisible to others. To do that I am trying to write a script for relevance of the delete button in the view, using application designer. The problem is the script is giving an error for CurrentUser says it is not in the context.

 

Any idea how can I see the current users' role?

 

Thanks in advance.

0 Likes
1 Solution

Accepted Solutions
Acclaimed Contributor.. Mark Cullen_1 Acclaimed Contributor..
Acclaimed Contributor..

Re: Application Designer button Relevance Script CurrentUser

Jump to solution

Use brackets...[CurrentUser].  If that doesn't work then you can try amLoginId().

0 Likes
8 Replies
Absent Member.. krishna_12127 Absent Member..
Absent Member..

Re: Application Designer button Relevance Script CurrentUser

Jump to solution

Hi,

 

You need to use CurrentUser.DefMastProfile.Description to refer the current user's role.

 

~Krishna

0 Likes
Absent Member.. Ceratophora Absent Member..
Absent Member..

Re: Application Designer button Relevance Script CurrentUser

Jump to solution

The thing as i said I cannot use CurrentUser, it gives

 

Variable not defined: 'CurrentUser'. ('Line 1 of script ''Relevance' of table 'Portfolio items (amPortfolio)''')

0 Likes
Acclaimed Contributor.. Mark Cullen_1 Acclaimed Contributor..
Acclaimed Contributor..

Re: Application Designer button Relevance Script CurrentUser

Jump to solution

Use brackets...[CurrentUser].  If that doesn't work then you can try amLoginId().

0 Likes
Jason_Dowd Acclaimed Contributor.
Acclaimed Contributor.

Re: Application Designer button Relevance Script CurrentUser

Jump to solution
As an additional note, if you're planning to use the AM Web, it's a known issue that putting relevance scripts on system buttons causes issues in the web client, so keep that in mind.
Jason Dowd
HPE Software Support

If this post has helped you resolve the issue, please flag it as solved.
0 Likes
Acclaimed Contributor.. Mark Cullen_1 Acclaimed Contributor..
Acclaimed Contributor..

Re: Application Designer button Relevance Script CurrentUser

Jump to solution

To enhance Jason's thread...it is my experience the web client does not like buttons that use IF-THEN-ELSE in the relevance attribute.  Standard "RetVal = ..." works just fine.

0 Likes
KMaheswari Absent Member.
Absent Member.

Re: Application Designer button Relevance Script CurrentUser

Jump to solution

Hi,

 

Is [CurrentUser] a table or field?

 

Regards,

Maheswari.K

0 Likes
Acclaimed Contributor.. Mark Cullen_1 Acclaimed Contributor..
Acclaimed Contributor..

Re: Application Designer button Relevance Script CurrentUser

Jump to solution

Neither.  It is considered a virtual link and is defined in the advanced use pdf guide (or see help).

0 Likes
KMaheswari Absent Member.
Absent Member.

Re: Application Designer button Relevance Script CurrentUser

Jump to solution

Mark,

 

Thanks for your info.

 

Maheswari.K

0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.