Difference between revisions of "System Call"

From SmartWiki
Jump to: navigation, search
Line 29: Line 29:
 
== System Call Examples ==
 
== System Call Examples ==
  
<!--SysCall_updatestatus(@objtype@,@objid@,'StatusName')-->
+
<pre><!--SysCall_updatestatus(@objtype@,@objid@,'StatusName')-->
 
<!--SysCall_workflow(@objtype@,@objid@,'myworkflow')@-->
 
<!--SysCall_workflow(@objtype@,@objid@,'myworkflow')@-->
 
<!--SysCall_workflow(23,@parent.objid@,'myworkflow')@-->
 
<!--SysCall_workflow(23,@parent.objid@,'myworkflow')@-->
<!--SysCall_workflow(levelone,@parent.objid@,'myworkflow')@-->
+
<!--SysCall_workflow(levelone,@parent.objid@,'myworkflow')@--></pre>
  
 
**@objtype@ and @objid@ are reserved words.
 
**@objtype@ and @objid@ are reserved words.

Revision as of 16:06, 11 February 2013

System Call Overview

The System Call feature of SmartSimple provides you with the ability to execute pre-defined system functions on the server and in the process avoid the creation of client side scripting. The benefits of System Calls are as follows:

  • Better performance and security as the execution of the code takes place on the server not in the client browser.
  • More stable as the System Calls are programmed by SmartSimple and optimized for the platform.
  • You don’t need to know JavaScript in order to use the feature.

Using System Calls

When using system calls you add the System Call references to a Browser Script type custom field. The syntax for each call is as follows:

<!--SysCall_function(@parameter 1@,@parameter 2@,@parameter N@)-->

Note Multiple System calls can be embedded in the same script field.

Triggering System Calls

The execution of the system call is controlled by the trigger that you set for the Browser Script field. The following triggers are supported.

  • on Load - SysCall is executed by the server when page is requested (no JavaScript is required)
  • on demand - SysCall is executed by the server when the user clicks a button on the page.
    • The button will be displayed for the browser script field when you select this type of trigger.
    • Note this is the only time the Browser Script field type has any visibility on a page.
  • on Save - SysCall is executed by the server when page is saved (no JavaScript is required).

System Call Examples

<!--SysCall_updatestatus(@objtype@,@objid@,'StatusName')-->
<!--SysCall_workflow(@objtype@,@objid@,'myworkflow')@-->
<!--SysCall_workflow(23,@parent.objid@,'myworkflow')@-->
<!--SysCall_workflow(levelone,@parent.objid@,'myworkflow')@-->
    • @objtype@ and @objid@ are reserved words.
    • Objtype can be referenced to the integer value associated with the entity type (23, 18, 30, 40) or constants can be used such as levelone, level1, leveltwo, level2, levelthree, level3, contact, people, company

Available System Calls

The following System Call are currently in production SysCall_updatestatus(objecttype,objectid,'StatusName')

Update the status of an object to a new status.

SysCall_workflow(objecttype,objectid,'WorkflowTriggerName') Call a workflow

SysCall_activatepeople(userid,activateType) Activate a contact as a user. The activateType can be set to: 0 = deactivate existing users 1 = activate user with access through the administrative or portal interface. 3 = activate user with access through Applicant Tracking Interface only. 5 = activate user with access web service login).

SysCall_updaterole(userid,updatetype,'rolesNamesDelimitedByCommas') Update user role. The updatetype can be set to: 1 = Add roles to contact. 2 = Remove all existing roles and add new roles. 3 = Remove listed roles.

SysCall_updatesysvar('VariableName','Description','VariableValue') Update existing System Variable to new value.

Proposed Additional System Calls

We welcome suggestions for additional system call that would reduce the need for scripting so please email SmartSimple Support or open a support ticket with the SmartSimple with the details of the System Call you would like to add. New