Updating the SalesLogix Contact Phone Book Crystal Report

Today, not only are we focusing on the Contact Phone Book Report which is a Crystal report that comes standard with an implementation of Sage SalesLogix, but also we are going to add some additional functionality to the Contact Address Book report that we improved upon in a previous post.  On November 28 2008 I wrote a blog post labeled SalesLogix Contact level Reports, the following is an exert on the Contact Phone Book report. 


Start Post————————————-


The Contact Phone book report is a report that could be removed from the system.  With some simple adaptations to the Contact Address Book report it could easily accomplish the same mission as this report is intended to carry out.  In the screen shot below you will see the fields that are included in the report.  Compare to the Address book and there is not a lot of difference.  If I were to improve this report I would again provide a parameter for Primary Contacts only and the ability to sort by Account.


 


End Post——————————————


I make two suggestions, first lets make the Contact Address Book work like two separate reports, then lets improve the existing Contact Phone Book report by allowing the user to see just the Primary Contacts as we did in the Contact Address Report. Also, allow the user to sort by either Accounts or Contacts Last Name.  All of this is completely achievable.  


Lets do the easy stuff first, lets get the Contact Address Report to double as both reports. To do this, let’s add a parameter field to the report.  In the tree control under the Crystal Field Explorer, find the group of [?] Parameter Fields, right click and select “New..” from the list.  The Create New Parameter form will Open.  We will Name this parameter “ContactPhoneList”, the Type will be “String”, under the Value section add “Yes” and “No” to the list,  under Value Options section I added the Prompt Text of “Run as Contact Phone List Report?”, then set the Prompt with Description only to “True”, Default to “No”, and Allow custom values to “False”. 


Next we need to add suppression formulas to several section of this report.  Right click on the Detail section c and select “Section Expert” from the list.  Find the suppress check box and look for the formula button directly across from the check box.  When the  Formula Workshop opens, paste this formula in:


or {?ContactPhoneList} = ‘Yes’


Once I closed the Formula Workshop for c, I opened the Detail section for i and pasted in the following formula:


{?ContactPhoneList} = ‘Yes’ 


I repeated the process  in i for Detail sections j through r.


Finally I created a new “Contact Phone List” label.  I set the suppression formula for the Contact Address List label to {?ContactPhoneList} = ‘Yes’ and ‘No’ for the Contract Phone List label. This Contact Address Book report now will perform double duty as the Contact Phone Book or Contact Address Book report based upon my selected parameters. 


The updated version of the Contact Address Book report is available using this link.



 



 


To improve upon the Contact Phone Book report as suggested, we will have to go a little deeper by using a formula field to determine our sort order field for the groups.  But let’s do the easy stuff first here also by creating a parameter field that will allow the user to display only Primary Contacts. First locate the Crystals Field Explorer tree control, find the group of [?] Parameter Fields, right click and select New.. from the list.  The Create New Parameter form will Open.  We will Name this parameter “Primary Only”, the Type will be “String”, under the Value section add “Yes” and “No” to the list,  under Value Options section I added the Prompt Text of “Display Primary Contacts Only?” then set the Prompt with Description only to “True”, Default to “Yes”, and Allow custom values to “False”. 


Next lets create a formula field that puts two stars by the first name of the Contact if they are the primary for the Account.  To create a formula field look in the Field Explorers tree control to find the list of Formula fields.  Right click and select “New..” from the menu that appears.  Label this formula “IsPrimary”.  Copy this formula into the Formula Workshop:


IF {CONTACT.ISPRIMARY} = ‘T’
then ‘**’
else ”


Drag and drop this new field between the “Name:” label and the TrimFullName field on the report. 


Now lets set up the report detail section to suppress records if they are not marked as Primary Contacts.  In the design tab, right click on the “Details a” section and select Section Expert from the menu that appears.  When the Section Expert form opens you will see that “Details a” is highlighted.  We really want to write this rule to the entire details section so click on the Details choice right above “Details a”  Select the button directly across from the Suppress check box on the right side of the view.  When the Formula Workshop opens copy this formula into the workspace provided.


{?Primary Only} = ‘Yes’ and {CONTACT.ISPRIMARY} = ‘F’


I also added a label to the report that defines the meaning of the double stars.


To get the report to sort by either the Account or the Contact Last Name is a little tricky.  First we need another parameter.


Create a new parameter and Name it “Sorting”, the Type will be “String”, under the Value section add “Account” and “Last Name” to the list,  under Value Options section I added the Prompt Text of “How do you want to sort this report?” then set the Prompt with Description only to “True”, Default to “Last Name”, and Allow custom values to “False”. 


Now, lets create a new sort by field, this field will tell Crystal how you want the report sorted.  create a formula field labeled “Sort”. Paste in the following formula:


if {?Sorting} = “Account” then {CONTACT.ACCOUNT}
else
{CONTACT.LASTNAME}


Right Click on the other existing formula field labeled “FirstLetter” and select “Rename” from the list, add the word “Name” to the end of the current label.  Take focus away from the field by clicking some where else in the Crystal Interface.  Right click on the same field and select “Duplicate” from the list.  You will see the “FirstLetterName 2” field appear in the formula field list. 


Right Click on the formula field labeled “FirstLetterName 2” and select “Rename” from the list, replace the text “Name 2” at the end of the current label with “Account”.  Take focus away from the field by clicking some where else in the Crystal Interface. Right click on the now labeled “FirstLetterAccount” formula field and select “Edit” from the list, then paste in the following formula:


{CONTACT.ACCOUNT}[1]


Now close the Formula Workshop for the “FirstLetterAccount” field, right click on the “Sort” formula field and select “Duplicate” from the list that appears.  Sort 2 will appear on the formula field list. Right click and select “Edit” from the list, then paste in the following formula:


if {?Sorting} = “Account” then {@FirstLetterAccount}
else
{@FirstLetterName}


Looking at the report in design mode, we will need to do some adjustments to the grouping and add some suppression formulas.  The first thing to do is get rid of the Group #2 which how the report sorted by last name, now we account for that in our formula fields.  Right click on the Group Header #1 and select “Change Group” from the list.  When the Change Group Options form opens, search in the top drop down for our new “Sort 2” field. Close the Change Group Options form.


Now right click on the Group Header #2 and select “Change Group” from the list.  When the Change Group Options form opens, search in the top drop down for our new “Sort” field.


Details section b is the Account field, this would be redundant data when viewing this report sorted by the Account field so lets add a suppression formula that reads like:


{?Sorting} = “Account”


We will want the Account Name to display when we are sorting by Account.  Add this to the suppression formula for the Group Header #2:


{?Sorting} = “Last Name”


That should be it. 




This report is available for download using this link.


Get all of our Free SalesLogix Reports here…


 Until next time…… Keep Smiling[:)]


 


 


 


 


 

Submit a Comment

Your email address will not be published. Required fields are marked *

Subscribe To Our Newsletter

Join our mailing list to receive the latest Infor CRM (Saleslogix) and Creatio (bpm'online) news and product updates!

You have Successfully Subscribed!