Skip to main content
July 28, 2021
Solved

Why am I getting this yellow warning message...

  • July 28, 2021
  • 6 replies
  • 0 views

This is the error message I receive when attempting the "user" function not the a!user function:

The user function does not have a domain prefix....

Best answer by stewart.burchell

the user function does have a domain - it's fn!

If you write it as fn!user() that message will disappear.

Some context: these are the available domains:

...and it's now been deemed best practice to prefix Appian constructs with their respective domain.

(just realized fn! doesn't appear in the above list, which seems to me an oversight! - I'll raise this with Appian Engineering)

6 replies

stewart.burchell
July 28, 2021

the user function does have a domain - it's fn!

If you write it as fn!user() that message will disappear.

Some context: these are the available domains:

...and it's now been deemed best practice to prefix Appian constructs with their respective domain.

(just realized fn! doesn't appear in the above list, which seems to me an oversight! - I'll raise this with Appian Engineering)

mikes0011
Brainy
July 28, 2021
and it's now been deemed best practice to prefix Appian constructs with their respective domain

Since when?  If this were the case, I'd expect that using the auto-fill rule picker in an expression/interface would populate the "fn!" domain like the "a!" domain is autopopulated - and at least as of 21.2, it isn't.

Also, FWIW, i'm unable to reproduce the warning message as seen in the initial screenshots here - I wonder if there might be some other issue at play?  Or do some people have ultra-early access to 21.3?

The Expression Guru
stewart.burchell
July 28, 2021

Prefixing Appian constructs has always been informally a best practice (if that's not an oxymoron! - I always insisted on it when peer reviewing code) and if you use the function picker (fx) in an Expression Editor that does append the relevant domain prefix (in 21.1)

If it's missing in the context you call out then I'd assert that needs to be amended.

July 28, 2021
Hi Anne & Mike -- I'd like to provide some additional context. While the fn! domain prefix exists, and can be used for system functions, we do not enforce this as a strict best practice. We only enforce the best practice of using the a! domain for rules (which is why, as you rightly pointed out Mike, autocomplete in the expression editor automatically adds a!). 
We recently had a bug where if you used BOTH a system function (such as user() or document()) AND you also had a rule input or variable with the same name (such as ri!user or local!document), then Appian would flag the system function as missing a domain. I believe that this is what you were seeing Anne.
We addressed and removed this bug with AN-186789, available in hotfix 21.2.385.0. As such, you should no longer see system functions called with parentheses underlined as requiring a domain.