This project has moved. For the latest updates, please go here.

Conditional Visibility for AUTHOR with Multi Language

Feb 13 at 11:16 AM
Edited Feb 13 at 1:50 PM
Hello,
currently I'm working on a Pool Car Reservation application.
One Requirement is, that Creator of a reservation and Application Owner will see all Details of an element, but other users will see only a few fields.
So far worked straight forward. But currently my issue is, that the validation of being "Author" is only working when Browser Language and therefore SharePoint Language is English. But in addition we have German language pack activated and this will be default for most of the users. So when switching the language from English to German, Author Rules do not apply.

Landscape: SP2016 on prem
No other custom solutions activated, but additional Content Editor WP on forms Webpartpage, to hide old form --> No Jumpy and to hide “Created By” Div

Is this a known issue or any idea why this appears?
I will know try to have a look at your source code
Best Regards
Michael


UPDATE: 1:24PM Maybe already found explanation within visibilityRuleCollection.js
There is line 828 looking for
                        var authorHref = $("span:contains('Created  at')").
                        find("a.ms-subtleLink").attr("href");
But if "created at" is the display text, this one gets translated and so Author rule does not find DOM node?
Will give it a quick and dirty try and come back here

UPDATE: Currently hanging on the Cache. Don't know how to force my system to clear cached Javascript file, so no chance to test my modifications of the RuleCollection.js...kind of frustrating

UPDATE: Managed to implement a Workaround. Created a always hidden Textfield "CalcCurrentUserLogin". On Create a workflow will write Current User Login to this field and conditional visibility Rule matches Field againts [CurrentUserLogin]. Btw: This was the only Variable I was able to get working. Especially Field adapter to provide default current username to people picker worked, but matching against [CurrentUser] did not. Where there some critical changes within SP2016 related to how this information is displayed?
I definitely would prefer to add some additional cases to visibilityRuleCollection
Coordinator
Feb 15 at 2:52 PM
Edited Feb 15 at 2:55 PM
The language issue is a known issue in SPEasyForms. There are very few places where I've hard-coded something that is language specific, but there are a couple (I think the Yes/No match for Boolean fields is another such issue). I used to have an issue to add localization to SPEasyForms, but it would only work if somebody translated my strings into other languages anyway. I just never got around to it, and I think it would be a lot of work.

As for the matching [CurrentUser], there is a section in the documentation that talks about exactly what I'm matching against and there are a couple of possibilities. Basically:

[CurrentUser] -- Gets replaced with a regular expression suitable for matching against a people picker field. The actual expression is:

“userdisp.aspx\?ID=” + currentUserId + “[$&]”

which matches the link to a user in a people picker.

[CurrentUserId] -- Gets replaced with the site collection integer id of the current user.

[CurrentUserLogin] -- Gets replaced with the current user’s login name. The format of the name may vary depending on the authentication method and SharePoint version. For instance this may be a domain name, or it may be a claims based name. Whatever appears in the user name field on userdisp.aspx is what will be used here.

[CurrentUserEmail] -- Gets replaced with the work email address of the current user.

So if you can make your calculated field match one of these, it should work.

Joe
Marked as answer by mcsheaj on 2/27/2017 at 9:49 AM