in Search

Hints, Tips and Tricks

Technical Hints Tips and Tricks that cover customization and development using Sage CRM. API usage and coding are covered.

Using the ##Codes

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#

Comments

 

Hints, Tips and Tricks said:

This article has been updated to allow download of files from this site. A little while ago I discussed

December 15, 2008 8:54
 

Hints, Tips and Tricks said:

The links in this article were corrected 22nd May 2009. Oh how angry I get with myself sometimes. I am

May 22, 2009 10:51

About Jeff Richards

As the Head of Training Program Development for Sage Technologies, I am responsible for providing the technical education for the Sage CRM Development Partner community. I write and present regularly on Sage CRM development techniques, hints and tips. I also provide education and training for the staff of local Sage companies in new technical features and act as a resource for Sage trainers as they develop their training courses. I have been working with Sage CRM since early 2001 (version 2.85) and I have a thorough understanding of the issues faced by partners carrying out implementations. I have been working within the Software Industry since 1993. I have a strong background in Business Rules and Workflow.

News

To help you find information quickly, use the tag cloud on the righthand side of the page. Every article and file posted is marked with one or more tags. The tags are mainly single words and are listed alphabetically. The more frequently a tag has been used to mark an article the bigger it will appear in the cloud. The tags are hyperlinks that lead to a collection of items that are associated with a tag. To find an article that discusses creating XML feeds using ASP pages, click on ASP, then on the next page click on XML.

This Blog

Syndication

sagecrm.com Articles