Changes

InRole

745 bytes added, 17:36, 20 October 2017
no edit summary
This syntax can be used on submit logic[[Submit Logic]], [[Advanced Logic]], [[Visibility Condition|visibility conditionconditions]], [[Custom Field Type: Special – Browser Script|browser script scripts]] or any other role -specific [[validation]]. It will always return a value, either true or false.
<pre>@object.inRole(Rolename)@</pre>
There are three things to use caution about this syntax.:
*'''Case Sensitive''' – Watch for The syntax must be '''inRole''' exactly: lower case “i” and upper case “R”*'''Do not encapsulate the whole syntax''' – This syntax always returns a value, either true or false which mostly would not cause any problems for example in [[sslogic ]] or visibility conditions. However, encapsulation of the syntax will return a string which is useless if not equalled equaled to another string. *'''Do not encapsulate the role name''' – This is looping the role names in the instance and tries to match what is in the brackets. Use the exact role name without encapsulatingquotes.
{|
|'''Correct''':
|'''''@me.inRole(Organization Contact)@'''''
|-
|<font color="red">'''Wrong''':</font>
|''"@owner.inRole(Organization Contact)@"'' - don't put quotes around the variable. It's a true/false value, not a string.
|-
|<font color="red">'''Wrong''':</font>
|''@me.inRole("Organization Contact")@'' - don't put quotes around the role name. The role name is ''Organization Contact'', not ''quote Organization Contact unquote''.
|-
|<font color="red">'''Wrong''':</font>
|''"@me.inRole("Organization Contact")@"'' - don't put quotes around both things...
|-
|<font color="red">'''Wrong''':</font>
|''@me.InRole(Organization Contact)@'' OR ''@me.inrole(Organization Contact)@'' - use the correct capitalization, ''inRole''
|-
|<font color="red">'''Wrong''':</font>
|''@me.inRole(''rolename1'' OR ''rolename2'')@'' - instead of this, use ''@me.inRole(''rolename1'')@ OR @me.inRole(''rolename2'')@''
|}
The syntax for the test of when a contact is ''not'Correct'in a role is to precede the '': 'inRole''variable with an exclamation point ("!").<pre>!@meobject.inRole(Organization ContactRolename)@'''</pre>
<font color="red">An example is that '''Wrong''':</font> "!@ownerme.inRole(Organization ContactAdministrator)@" '' will return true only when the current user is not in the role of Administrator.
<font color="red">'''Wrong''':</font> @me.inRole("Organization Contact")@
<font color="red">'''Wrong''':</font> "@me.inRole("Organization Contact")@"=See Also==* [[Boolean Operators]]
<font color="red">'''Wrong'''[[Category:</font> @me.InRole(Organization Contact)@ OR @me.inrole(Organization Contact)@ <font color="red">'''Wrong''':</font> @me.inRole(''rolename1'' OR ''rolename2'')@  ''For multiple role names use: @me.inRole(''rolename1'')@ OR @me.inRole(''rolename2'')@To Move Later]]
Smartstaff, administrator
686
edits