Using the ##Codes
The ##Codes are used in the form #fieldname# and indicate the field data that that should be substitued as the meta data is parsed.
The ##Codes are used in Email Templates and Workflow Actions, including Quick Notification Actions and Translations associated with Notifications.
Usage in Email Templates
Email Templates associated with an Entity can draw use data from the main summary view for that entity.
An email template to be used in the context of a company uses vSummaryCompany and the template can refer to any field in the view:
SQL of vSummaryCompany View:
SELECT RTRIM(ISNULL(Pers_FirstName, '')) + ' ' + RTRIM(ISNULL(Pers_LastName, '')) AS Pers_FullName, RTRIM(ISNULL(User_FirstName, '')) + ' ' + RTRIM(ISNULL(User_LastName, '')) AS User_Name, vAddress.*, Person.*, Company.*, Users.* FROM Company LEFT OUTER JOIN vAddress ON Comp_PrimaryAddressId = Addr_AddressId LEFT OUTER JOIN Person ON Comp_PrimaryPersonId = Pers_PersonId AND Pers_Deleted IS NULL LEFT OUTER JOIN Users ON Comp_PrimaryUserId = User_UserId WHERE Comp_Deleted IS NULL
Email Context and View Used:
Cases - vSummaryCase
Company - vSummaryCompany
Lead - vSummaryLead
Opportunity - vSummaryOpportunity
Person - vSummaryPerson
N.B. All contexts can also use the fields from vSearchListUser
SQL of vSearchListUser:
SELECT RTRIM(ISNULL(User_FirstName, '')) + ' ' + RTRIM(ISNULL(User_LastName, '')) AS User_Name, RTRIM(ISNULL(User_FirstName, '')) + ' ' + RTRIM(ISNULL(User_LastName, '')) AS User_DisplayName, User_Per_Admin AS User_PWDProfile, Users.* FROM Users WHERE User_Deleted IS NULL
Example Case Email Template
#pers_firstname# #pers_lastname#
Your support request on behalf of #comp_name# has been allocated the Reference ID #case_referenceid#. Please can you check the following details of the #case_description# issue.
#case_problemnote#
If there are any further details that you can provide then please send them to me quoting the reference number: #case_referenceid#.
Regards
#user_firstname# #user_lastname#
Usage in Workflow Actions
Set Column Value - In the Value field. For example,#user_userid#. This is only able to reference the fields main entity in context. In a Primary Rule the current user is in context.
Create Task - In any of the default values fields. For example, #case_assigneduserid#.
Create Opportunity - In any of the default values fields. For example, #oppo_assigneduserid#.
Create Case - In any of the default values fields. For example, #oppo_description#.
Execute SQL Statement - In the SQL Statement field.
Show Notification On Screen - In the Message field.
Send E-mail - In the E-mail To, E-mail Subject and E-mail Contents fields. For example, #case_assigneduserid#.
SMS - In the E-mail To, E-mail Subject, and E-mail Contents fields. For example, #case_assigneduserid#.
Example Usage in Create Task (for Opportunity Workflow)
Contents of "Details Field":
Check the details for the new #oppo_description# lead. Speak to #pers_firstname# #pers_lastname# at #comp_name#.
The vSummaryOpportunity view can be used in this context.
Example Usage in Escalation Rule Notification Action
This is an example of the translation that is associated with the caption code "commnotify" called by Notification Action of the default "Communication Reminder" escalation rule.
#comm_action# #comm_datetime# - #comm_note#
This type of usage in Translations is only suitable for Notification captions called by workflow rule actions.
Example Usage in Workflow Action - Execute SQL Statement
The sql field of the Execute SQL Statement can contain ##Codes, for example:
update Comm_Link set CmLi_Deleted = 1 where CmLi_Comm_CommunicationId in (select Comm_CommunicationId from Communication where Comm_WaveItemId=#WaIt_WaveItemId#);update Communication set Comm_Deleted=1 where Comm_WaveItemId=#WaIt_WaveItemId#