Difference between revisions of "Advanced Logic"

From SmartWiki
Jump to: navigation, search
(Sample Condition Statements)
 
(59 intermediate revisions by 6 users not shown)
Line 1: Line 1:
 
'''Advanced Logic''' gives [[System Administrator]]s a higher level of control over the entire interface.  
 
'''Advanced Logic''' gives [[System Administrator]]s a higher level of control over the entire interface.  
  
This feature allows control of the visibility and/or access to [[Interfaces|interface]] elements such as buttons or tabs based on [[Administrator|administrator]] defined conditions.  
+
This feature allows control of the [[visibility]] and/or access to [[Interfaces|interface]] elements such as buttons or tabs based on [[Administrator|administrator]] defined conditions.  
  
[[Image:AdvancedLogic.png]]
+
[[Image:AdvancedLogicAugust2014.png|link=]]
  
 
==Location==
 
==Location==
 
This feature is available in 3 places:
 
This feature is available in 3 places:
# [[Global Settings]] - to establish system-wide rules.
+
# '''Advanced Logic''' link on the [[Global Settings]] page (In the [[Business & System Configuration]] section) - to establish system-wide rules.
# [[Universal Tracking Application]]'s Setting's Page - for rules specific the each UTA.
+
# '''Advanced Logic''' link on the '''Settings''' Page within each [[Universal Tracking Application]] - for rules specific to each UTA.
# [[:Category:Personal Transactions|Transaction Types]] page - for both ''People'' and ''Company'' Transaction Types
+
# In the [[:Category:Transactions|Transaction Types]] section on [[Global Settings]] - for both ''People'' and ''Company'' Transaction Types
  
  
Line 17: Line 17:
  
 
==Overview==
 
==Overview==
 +
'''Object''': The object that is being controlled.<br />
 +
'''Condition''': A logical statement that when true will make the object statement true, and when false will make the object statement false.
  
 +
* If the '''Object''' says "Show Level 1 Save Button", if the statement in the '''Condition''' field is true the Save button will be shown.
 +
* If the '''Object''' says "Hide Top Invoice Tab", if the statement in the '''Condition''' field is true the Invoice Tab will be hidden.
 +
* If the '''Object''' says "Disable Delete Level 1 Contacts", if the statement in the '''Condition''' field is true, deleting Level 1 contacts will be disabled (meaning deletion won't be possible).
  
''For example, you can disable the '''Delete''' button when viewing '''Contacts''' for [[User]]s in a specific [[Role|role]] by using the '''Advanced Logic''' setting on the [[Global Settings]] page.
 
  
 +
''For example, you can disable the '''Delete''' button when viewing '''Contacts''' at Level 1 for [[User]]s in a specific [[Role|role]] by using the '''Advanced Logic''' setting on the [[Global Settings]] page.
 +
:[[Image:AdvancedLogicDCAugust2014.png|link=]]
  
 +
''In the above example, users who are in the role "Program Director" or "Applicant" will be prevented from deleting contacts at {{l1}}.''
  
This is currently available for: - the '''Level 2 Copy''' button. - '''Hide Notes''' at '''Level One''', '''Level Two''' and '''Level Three'''.
+
==Sample Conditional Statements==
  
 +
'''NOTE:''' When possible, avoid using IDs (i.e., typeid, statusid). Using field names rather than IDs allows for better readability and cloning.
  
i.e. Put the following into the '''Condition''' box:
+
* Using role name vs. role id
 +
!@me.inRole(Organization Contact)@
 +
          rather than
 +
'instr('@me.rolelist@',',10733,')=0'
  
<nowiki>instr(concat(',','@me.rolelist@',','),',roleid#,')</nowiki>
 
  
 +
* Not true for the Level 1 template with typeid ''12345''
 +
'@opportunity.typeid@'<>'12345'
 +
            or
 +
'@opportunity.typeid@'Not In('12345')
  
For example,
 
'''instr(concat(',','@me.rolelist@',','),',9999,') OR instr(concat(',','@me.rolelist@',','),',1111,')'''                                where 9999 and 1111 are role ids.
 
  
==Sample Condition Statements==
+
* True if the Level 1 status is 'Draft':
 +
'@opportunity.status@'='Draft'
 +
            or
 +
'@opportunity.status@' In ('Draft')
  
  
* '''<nowiki>'@opportunity.typename@'<>'TemplateName'</nowiki>''' - not true for template "TemplateName"
+
* True unless the Level 1 status is 'Draft' or 'Open':
* '''<nowiki>'@opportunity.statusid@'='765'</nowiki>''' - true for status with ID 765
+
'@opportunity.status@' Not In ('Draft','Open')  
* '''<nowiki>'@opportunity.statusid@' In ('765','766')</nowiki>''' - true for statuses with ID 765 and 766
 
* '''<nowiki>'@opportunity.statusid@' Not In ('765','766')</nowiki>''' - true for status with IDs other than 765 and 766
 
* '''1=0''' - never true
 
  
  
[[Category:Global Settings]][[Category:Universal Tracking Application]]
+
* True if the Level 1 statusid is 765 or 766
 +
'@opportunity.statusid@' In ('765','766')
 +
 
 +
 
 +
* True if the Level 1 statusid is NOT 765 or 766
 +
'@opportunity.statusid@' Not In ('765','766')
 +
 
 +
 
 +
* True when current user is in the role ''Program Director'' or ''Applicant'':
 +
@me.inRole(Program Director)@ OR @me.inRole(Applicant)@
 +
 
 +
 
 +
* False when current user is in both the roles ''Program Director'' and ''Applicant'':
 +
!@me.inRole(Program Director)@ AND !@me.inRole(Applicant)@
 +
 
 +
 
 +
* For a advanced logic based the '''startdate''' or '''enddate''' standard fields:
 +
::* Use ''''@fullstartdate@'''' rather than ''''@startdate@'''' and ''''@fullenddate@'''' rather than ''''@enddate@''''.
 +
:''This will format the stored date as yyyy-mm-dd so it can be compared using < and >.''
 +
'@fullstartdate@' >= '2009-05-01'
 +
 
 +
 
 +
* True if today's date is after the Start Date:
 +
now()>'@fullstartdate@'
 +
 
 +
 
 +
* Never True
 +
1=0
 +
 
 +
 
 +
* Always True
 +
1=1
 +
 
 +
 
 +
 
 +
'''<u>IMPORTANT</u>'''
 +
 
 +
The syntax used will vary depending on which '''Object''' is being controlled.<br>
 +
For example, consider the '''Show Level 3 New Button'''. This button is shown when you are viewing a Level 2 record.
 +
* If you want to control the visibility of the Level 3 New button based on the status of the '''Level 2''' item you would use:
 +
'@statusid@' In ('765','766')
 +
 
 +
 
 +
* If you want to control the visibility of the Level 3 New button based on the status of the '''Level 1''' item you would use:
 +
'@opportunity.statusid@' In ('765','766')
 +
 
 +
 
 +
 
 +
==See Also==
 +
 
 +
To see the options available for Advanced Logic settings, visit our [[Advanced Logic Options]] page.
 +
 
 +
* [[Boolean Operators]]
 +
* [[UTA Settings Page]]
 +
* [[inRole]]
 +
 
 +
[[Category:Global Settings]][[Category:UTA Settings]][[Category:Universal Tracking Application]][[Category:Advanced Logic]]

Latest revision as of 13:18, 13 August 2014

Advanced Logic gives System Administrators a higher level of control over the entire interface.

This feature allows control of the visibility and/or access to interface elements such as buttons or tabs based on administrator defined conditions.

AdvancedLogicAugust2014.png

Location

This feature is available in 3 places:

  1. Advanced Logic link on the Global Settings page (In the Business & System Configuration section) - to establish system-wide rules.
  2. Advanced Logic link on the Settings Page within each Universal Tracking Application - for rules specific to each UTA.
  3. In the Transaction Types section on Global Settings - for both People and Company Transaction Types


Advanced Logic on Transaction Types only has one control:
It allows you to show/hide the Links button for individual Transaction Types.
The Links button allows a Transaction to be linked to UTAs when viewing the Transaction.

Overview

Object: The object that is being controlled.
Condition: A logical statement that when true will make the object statement true, and when false will make the object statement false.

  • If the Object says "Show Level 1 Save Button", if the statement in the Condition field is true the Save button will be shown.
  • If the Object says "Hide Top Invoice Tab", if the statement in the Condition field is true the Invoice Tab will be hidden.
  • If the Object says "Disable Delete Level 1 Contacts", if the statement in the Condition field is true, deleting Level 1 contacts will be disabled (meaning deletion won't be possible).


For example, you can disable the Delete button when viewing Contacts at Level 1 for Users in a specific role by using the Advanced Logic setting on the Global Settings page.

AdvancedLogicDCAugust2014.png

In the above example, users who are in the role "Program Director" or "Applicant" will be prevented from deleting contacts at Level 1.

Sample Conditional Statements

NOTE: When possible, avoid using IDs (i.e., typeid, statusid). Using field names rather than IDs allows for better readability and cloning.

  • Using role name vs. role id
!@me.inRole(Organization Contact)@
         rather than
'instr('@me.rolelist@',',10733,')=0'


  • Not true for the Level 1 template with typeid 12345
'@opportunity.typeid@'<>'12345'
            or
'@opportunity.typeid@'Not In('12345')


  • True if the Level 1 status is 'Draft':
'@opportunity.status@'='Draft'
            or
'@opportunity.status@' In ('Draft')


  • True unless the Level 1 status is 'Draft' or 'Open':
'@opportunity.status@' Not In ('Draft','Open') 


  • True if the Level 1 statusid is 765 or 766
'@opportunity.statusid@' In ('765','766') 


  • True if the Level 1 statusid is NOT 765 or 766
'@opportunity.statusid@' Not In ('765','766')


  • True when current user is in the role Program Director or Applicant:
@me.inRole(Program Director)@ OR @me.inRole(Applicant)@ 


  • False when current user is in both the roles Program Director and Applicant:
!@me.inRole(Program Director)@ AND !@me.inRole(Applicant)@


  • For a advanced logic based the startdate or enddate standard fields:
  • Use '@fullstartdate@' rather than '@startdate@' and '@fullenddate@' rather than '@enddate@'.
This will format the stored date as yyyy-mm-dd so it can be compared using < and >.
'@fullstartdate@' >= '2009-05-01'


  • True if today's date is after the Start Date:
now()>'@fullstartdate@'


  • Never True
1=0 


  • Always True
1=1


IMPORTANT

The syntax used will vary depending on which Object is being controlled.
For example, consider the Show Level 3 New Button. This button is shown when you are viewing a Level 2 record.

  • If you want to control the visibility of the Level 3 New button based on the status of the Level 2 item you would use:
'@statusid@' In ('765','766')


  • If you want to control the visibility of the Level 3 New button based on the status of the Level 1 item you would use:
'@opportunity.statusid@' In ('765','766')


See Also

To see the options available for Advanced Logic settings, visit our Advanced Logic Options page.