$CurrentUser vs. [%CurrentUser%] in Xpath

1
In an Xpath constraint on a retrieve action, what is the difference between $CurrentUser and [%CurrentUser%]? Are there cases where I should use one instead of the other?
asked
1 answers
5

The difference is that $currentUser represents a user object whereas [%CurrentUser%] is just an id of the actual object. So if you would ever need the name attribute of the current user in a retrieve then you can only use the $currentUser. However in practise you almost always use an association to retrieve entities and thus makes the id pointer as good as a choice.

answered