When updating subentity information (wce_activity, wce_sales, wce_history, custom subentity tables) you can trigger three types of actions:
Some subentity dialogs have default conditional trigger behaviors that can be overridden.
Conditional Field Changes
You can assign a value to a field if a specific condition is met. For example, you may want to update the EditTime field of a contact table every time a note is changed for a contact. Conditional Field Change triggers are defined in the
<#conditionalfieldchangex>/<#/conditionalfieldchangex>
sections - where x is an integer value (1, 2 or 3 for example). You setup the parameters for the Conditional Field Change trigger in this section. Parameters are:
<#conditionalfieldchange3> testbefore=1=1 testafter=Note=<#params value='_htype'> field=EditTime fieldValue=<#date> <#time> entitytable=<#params value='etable'> entitytablefield=uniqueid entitytablevalue=<#parent field=uniqueid> <#/conditionalfieldchange3> |
The TestAfter conditional statement is checking one of the parameters from the dialog - the _HType parameter, which corresponds to the HType field in the wce_history table. To see what parameters are available for a given dialog, you can View...Source that dialog after it's been rendered by WCE. If this parameter equals the value "Note", then the statement evaluates to true, and the Conditional Field Change is executed.
The Field parameter is the field that will be updated with the FieldValue parameter. Note that the FieldValue in this case is being populated with the WCE tags <#date> and <#time> which will create a current date/time stamp.
Since we're not updating wce_history in this case, we need to identify the table and the record that we're going to update. That's where the EntityTable parameters are used. In this case, the wce_contact is being updated, using the record identified by the ParentEntityID carried by the EditHistory dialog.
Any dialog clearing an activity (Schedule.html) has two default Conditional Field Change sections - one for updating the LastReach or LastMeeting fields for Completed Calls/Completed Meetings, and one for updating the Edit. You can override these default sections by adding sections of the same name. Here are the default sections:
(For activity type Meeting)
<#conditionalfieldchange> testbefore=1=1 testafter=Meeting Held=<#params value='_htype'> field=lastmeeting fieldvalue=<#params value='_date'> <#params value='_time'> entitytable=<#params value='etable'> entitytablefield=UNIQUEID entitytablevalue=<#parent field=uniqueid> <#/conditionalfieldchange1>
|
<#conditionalfieldchange1> testbefore=1=1 testafter=Call Completed=<#params value='_htype'> field=lastreach fieldvalue=<#params value='_date'> <#params value='_time'> entitytable=<#params value='etable'> entitytablefield=UNIQUEID entitytablevalue=<#parent field=uniqueid> <#/conditionalfieldchange1>
|
Adds updating LastAttempt field if cleared call was attempted: <#conditionalfieldchange3> testbefore=1=1 testafter=Call Attempted=<#params value='_htype'> field=lastattempt fieldvalue=<#params value='_date'> <#params value='_time'> entitytable=<#params value='etable'> entitytablefield=UNIQUEID entitytablevalue=<#parent field=uniqueid> <#/conditionalfieldchange3>
Adds updating LastAttempt field if caller left message:
Updates EditTime if any conditional field changes were met: |
<#RecordHistory1> testbefore=<#field field=salestatus blank="" notblank="open">=<#field field=salestatus> testafter=Open<><#field field=salestatus> _HType=<#field field=salestatus test1='Won' val1='Completed/Won' test2='Lost' val2='Lost Sale'> _subject=Completed Sale for <#parent field=EntityNameField>, <#parent field=EntityName2Field> _Notes=Sales Stage <#field field=stage><br>Product Name: <#field field=productname><br>Product Type: <#field field=producttype><br>...Details: <#field field=notes> <#/RecordHistory1>
|
Conditionally Sending Email
You can send an email if a specific condition is met. For example, you may want to send an email when you close a sale. Conditional Email triggers are defined in the
<#sendemailx>/<#/sendemailx>
sections - where x is an integer value (1, 2 or 3 for example). You setup the parameters for the Conditional Email trigger in this section. Parameters are:
<#sendemail1> testbefore=won<><#field field=salestatus> testafter=won=<#field field=salestatus> subject=Completed sale for <#parent field=EntityNameField> htmltemplate=C:\Inetpub\Wirede\HTMLTemplates\LetterHead 1.htm msgtemplate=c:\inetpub\wirede\email\completedsale.txt to=employees@wiredcontact.com <#/sendemail1> |