In Standard Processes you can configure secondary operations to happen in the case of other operations.


This is a very powerful part of ClickHome, and can be used to replace custom SQL procedures and make management, upgrading and support much easier.


The information is configured into an existing table called tblStandardProcesses - currently there is no UI, but we can develop many examples that can easily be added to the system.


Configuration

  • Business Unit - This is the parent business unit - this operation will be performed against all business units below this business unit.
  • Operation Code - This is the operation code we are checking for.. When this operation happens in the system, then we perform the operation
  • Run Events - This is an XML entry which determines the operations that are scheduled into the backend jobs.


Run Events

This is an XML text segment... The structure is as follows

  • Actions - a holding place for multiple Action elements
  • Action - this is the main element. It has two attributes, and contains parameter elements
    • Name - This is mainly for Display purposes
    • OpCode - This is the Operation Code that gets run when this action is triggered 
  • Param (or Parm - supports both) - This is the parameter of the backend job that needs to be set. It can optionally have a value, or an attribute called Source
    • Source - this is the field name of the current object ie the record being updated by the triggering op code..


Examples

Here are some examples:


Call a WebHook Endpoint when a New User is Created

Standard Process Operation Code - 17008


<actions>

<action name="URL Trigger" opcode="26041">

<parm name="sgTextValue1">http://api.webhookinbox.com/i/uASvk3d5/in/?idSupplier={0}</parm>

<parm name="fkidPrimaryKey" source="idUser" />

</action>

</actions>


In this example sgTextValue1 is set to a URL from a system called webhookinbox that can be used to test web hooks. fkidPrimaryKey is set to the idUser property of the user that was created.


Send an Email to Members of a Security Group When Land is Commit to Buy 

Standard Process Operation Code - 2740


<actions>

<action name="Notify Sales" opcode="1106">

<parm name="inIDValue1">1047</parm>

<parm name="inIDValue2">9</parm>

<parm name="sgTextValue1">Title</parm>

<parm name="sgTextValue2">More detailed instructions</parm>  

</action> 

</actions>


In this example inIDValue is set to the Activity template, inIDValue1 is the security group, sgTextValue1 is the title of the message, and sgTextValue2 is an instruction to be included in the body of the message.


Add a Note when a Contract Status of a Job is changed

Eg: Suppose we are changing the contract status of the job to Cancel.


Standard Process Operation Code - 2117


<actions>

<action name="NoteAddNew" opcode="8103" >

<parm name="mNotes">This job was cancelled</parm>

<parm name="sgTextValue1">Job Cancelled</parm>

<parm name="fkidContract" source="idContract" />

</action></actions>


Update Last Activity Date on a Contract

Standard Process Operation Code - 7103



<actions>

<action name="Inaction" opcode="8220" />

</actions>


In this example, there are no parameters.


Last Activity Date

The Last Activity Date on a contract is used to determine escalation procedures for in active jobs. Once a day, the system runs a query on jobs based on the last activity date, and runs the corresponding standard processes table based on the op codes listed below. This can be used as per the examples below.


Send Email based on 2 Weeks of Inaction

Standard Process Operation Code - 8222


<actions>

<action name="Inaction" opcode="8220" />

<action name="Complete" opcode="1100" >

<parm name="mNotes">This lead has not been followed up in 2 weeks</parm>

<parm name="sgTextValue1">Inactive Lead</parm>

</action>

</actions>


In this example, the body of the message is This Led has not been followed up in 2 weeks, and the subject of the message is Inactive Lead.




Notes:

Then you have the option for Operation Code 8220 to be configured in Standard Processes to happen on things like change status, new note, new meeting, task completed, flex field saved etc. This means the client can determine what triggers the dtLastActivityDate to be updated. Then, operation codes from 8221 to 8266 can be executed to cause operations on the contract - Notifications etc.


Operation Codes that can be set up in this example:

8221 Contract Last Activity Date 1 Week

8222 Contract Last Activity Date 2 Weeks

8223 Contract Last Activity Date 1 Month

8224 Contract Last Activity Date 3 Months

8225 Contract Last Activity Date 6 Months

8226 Contract Last Activity Date 12 Months

8231 Contract Last Activity Date Land 1 Week

8232 Contract Last Activity Date Land 2 Weeks

8233 Contract Last Activity Date Land 1 Month

8234 Contract Last Activity Date Land 3 Months

8235 Contract Last Activity Date Land 6 Months

8236 Contract Last Activity Date Land 12 Months

8241 Contract Last Activity Date Leads 1 Week

8242 Contract Last Activity Date Leads 2 Weeks

8243 Contract Last Activity Date Leads 1 Month

8244 Contract Last Activity Date Leads 3 Months

8245 Contract Last Activity Date Leads 6 Months

8246 Contract Last Activity Date Leads 12 Months

8251 Contract Last Activity Date Presite 1 Week

8252 Contract Last Activity Date Presite 2 Weeks

8253 Contract Last Activity Date Presite 1 Month

8254 Contract Last Activity Date Presite 3 Months

8255 Contract Last Activity Date Presite 6 Months

8256 Contract Last Activity Date Presite 12 Months

8261 Contract Last Activity Date Construction 1 Week

8262 Contract Last Activity Date Construction 2 Weeks

8263 Contract Last Activity Date Construction 1 Month

8264 Contract Last Activity Date Construction 3 Months

8265 Contract Last Activity Date Construction 6 Months

8266 Contract Last Activity Date Construction 12 Months


When an operation code is applied against a contract, a record in tblContractOperationFlag is created to store the contract's id, the operation code, and the time (when the operation code is invoked) to make sure during each time frame specified by the operation code only one execution of the operation is carried out.