Accelerator Customisation: Difference between revisions

From Accelerator for SageCRM
No edit summary
No edit summary
 
(3 intermediate revisions by the same user not shown)
Line 1: Line 1:
*The following is advanced functionality and should only be attempted by someone with knowledge of their server. For best results contact 'CRM Together' or your Sage CRM partner.
*The following is advanced functionality and should only be attempted by someone with knowledge of their server. For best results contact 'CRM Together' or your Sage CRM partner.
The IE Toolbar and the Outlook add on can be customised with custom buttons defined in the Web.config file.
*For IE buttons search for the section "CustomButtons". Within the "buttons" section you add in the button details. Different types of buttons can be created and the type is specified by the "Type" attribute.
There are different types of buttons that can be added to execute the following
1. Sage CRM Custom Page.
2. WS Script file
3. Custom downloaded application
4. Local system application
Example of some buttons and their Types
<CustomButtons>
  <buttons>
      <add Name="scriptsample" Type="script" File="sample.js" Text="Script Sample" Alt="Script Sample" Image="solution" EnableContext="Person,Company" EnableOffline="off"/>
      <add Name="customappsample" Type="process" File="ClientApp.exe" Text="Custom App" Alt="Custom Application" Image="cases" EnableContext="Person" EnableOffline="off"/>
      <add Name="calc" Type="localprocess" File="calc.exe" Text="Calc" Alt="Calculator" Image="opportunity" EnableContext="Opportunity" EnableOffline="off"/>
  </buttons>
</CustomButtons>
*Similarly custom drop downs can also be created within the "CustomDropDowns" section
<CustomDropDowns>
    <dropdown Name="sampleDD" Text="Sample 1" Alt="Sample 1" Image="company" EnableContext="Person" EnableOffline="off" >
      <add Name="scriptsample" Type="script" File="sample.js" Text="Script Sample" Alt="Script Sample" Image="solution"  />
      <add Name="customappsample" Type="process" File="ClientApp.exe" Text="Custom App" Alt="Custom Application" Image="cases"  />
      <add Name="calc" Type="localprocess" File="calc.exe" Text="Calc" Alt="Calculator" Image="opportunity" />
    </dropdown>
</CustomDropDowns>
*For Outlook buttons on the main explorer window can be created with the following syntax
  <CustomButtonsOutlook>
    <buttons>
      <add Name="Logoff" Type="process" File="AcceleratorLogoff.exe" Text="Log Off" Alt="Log Off" Image="cases" />
    </buttons>   
  </CustomButtonsOutlook>
*Within the CRM Explorer section (this is the area displaying the CRM data) you can create drop down buttons using the following syntax
  <CustomDropDownsOutlook>
    <dropdown Name="sampleDD" Text="Sample 1" Alt="Sample 1" Image="company" EnableContext="Person,Company" EnableOffline="off" >
      <add Name="customappsample" Type="process" File="ClientApp.exe" Text="Custom App" Alt="Custom Application" Image="cases"  />
      <add Name="calc" Type="localprocess" File="calc.exe" Text="Calc" Alt="Calculator" Image="opportunity" />
      <add Name="scriptsample" Type="script" File="sample.js" Text="Script Sample" Alt="Script Sample" Image="solution"  />
    </dropdown>
  </CustomDropDownsOutlook>
----
'''Enable Context'''
When buttons and drop downs are enabled is important to control and we have improved this ability to now include using querystring values.
Previously you could only control enablement using the main entities. For example to enable a button for a person you would set the "EnableContext" value to "Person".
EnableContext="Person"
The button text is as below
    <add Name="customappsample" Type="process" File="ClientApp.exe" Text="Custom App" Alt="Custom Application" Image="cases" EnableContext="Person,Company" EnableOffline="off"/>
This will continue to work but now you can also get the system to check for a query string value.
For example if you wanted to create a button to do some function for a Wave Activity you might have the system check for "Key35" so that the button is only enabled when a wave activity is being viewed. To do this you would set
EnableContext="QSContext_Key35"
So you can see that the prefix for a query string check is "QSContext_" followed by the query string name.


----
----
Line 237: Line 160:
       capt_us='Sales'
       capt_us='Sales'
     *On the client then clear the cache for the translations to reload.
     *On the client then clear the cache for the translations to reload.
New as of 2014 release we have the ability to seperately set the IE toolbar search options
    <add key="SearchEntitiesIE" value="Company,Person,Lead,Cases,Opportunity"/>


and add in new keys as follows in this example
and add in new keys as follows in this example
Line 557: Line 476:


Restart outlook to test
Restart outlook to test
----
User Select fields (setting default user)
On a NEW screen you might want to set a case to be assigned to the company account manager.
To do this you first must open the field (EG case_assigneduserid) and set the default to be
  No Default
*there is a trade off here so in that you may lose the current user from being set. I would also then recommend that you set the field to be required.
The in the screen-field createscript you can set the DefaultValue
EG
  DefaultValue=CRM.GetContextInfo("company","comp_primaryuserid");
----
To edit the NEW menu the "NewEntities" option is available
  <add key="NewEntities" value="Company,Person,Cases,Opportunity,Lead" />
----
User Lookups in Accelerator Screens
These can be configured using the following setting
  <add key="userlookupsql" value="select user_userid, user_fullname from vusers where user_disabled is null order by user_firstname" />

Latest revision as of 09:01, 29 April 2020

  • The following is advanced functionality and should only be attempted by someone with knowledge of their server. For best results contact 'CRM Together' or your Sage CRM partner.

To turn on the Appointment/Tasks (one way from Outlook to CRM) your system administrator must edit the "DisableApptTask" setting in the web.config file.

The web.config file is located in your CRM "custompages/sagecrmws" folder

Default

 <add key="DisableApptTask" value="Y" />

Change to be

 <add key="DisableApptTask" value="N" />

DO NOT TURN THIS ON IF YOU ARE USING SAGE CRM'S NATIVE SYNC OR ANY THIRD PARTY SYNC TOOL


Workflow

To enable workflow within the Outlook Modules you must (in the web.config file) set the values

   <add key="entityname_WorkflowName" value=""/>
   <add key="entityname_WFState" value=""/>

For example for cases you might set it to be

   <add key="cases_WorkflowName" value="Case Workflow"/>
   <add key="cases_WFState" value="Logged"/>
  • Please ensure that the workflow state is the state name in the workflow and not in the case_stage. Usually these look the same but not always and are in fact distinct from each other.

Email Filing date

By default the system will set the communication date to be the date it is filed.

To set it to the option to use the email date.

Set to "N" to turn off. Default value is "Y"

   <add key="UseEmailDatetime" value="Y" />
  • Warning: we do not recommend this setting as different regions send the date differently and can cause issues.

Required fields

Even though the screens that you see in Accelerator are accessible in CRM allowing you to set fields as required fields we advise adding client-side code to the custom content section.

By default the system uses a javascript method called _onSubmitValidate()

This looks as follows

   function _onSubmitValidate()
   {
     var s_comp_name=document.getElementById("comp_name");
     var s_pers_lastname=document.getElementById("pers_lastname");
     var s_pers_firstname=document.getElementById("pers_firstname");
     var s_addr_address1=document.getElementById("addr_address1");
     if (s_addr_address1.value=="")
       s_addr_address1.value="-";
     if ( (s_comp_name.value!="") && (s_pers_lastname.value!="") && 
          (s_pers_firstname.value!="") && (s_addr_address1.value!="") )
     {
       document[0].submit();
     }
     else
     {
       alert("Please fill in all required fields.");
     }
   }

You can see it checks if fields have values set and does not allow the user submit the form unless they do. If for example we need to have the comp_website field as required we would have to alter the code as follows

   function _onSubmitValidate()
   {
     var s_comp_name=document.getElementById("comp_name");
     var s_comp_website=document.getElementById("comp_website");
     var s_pers_lastname=document.getElementById("pers_lastname");
     var s_pers_firstname=document.getElementById("pers_firstname");
     var s_addr_address1=document.getElementById("addr_address1");
     if (s_addr_address1.value=="")
       s_addr_address1.value="-";
     if ( (s_comp_name.value!="") && (s_pers_lastname.value!="") && 
          (s_pers_firstname.value!="") && (s_addr_address1.value!="") &&
          (s_comp_website.value!="") )
     {
       document[0].submit();
     }
     else
     {
       alert("Please fill in all required fields.");
     }
   }
  • Don't forget to add in the script tags around your code <script>...your code</script> when putting it into the custom content



List Length

You can configure the length of lists in the system with a setting in the web.config file

The setting is in the format

  <add key="entityname_ListLength" value="10" />

EG

 <add key="cases_ListLength" value="10" />
  • for case lists you must set two values
 <add key="cases_ListLength" value="10" />
 <add key="case_ListLength" value="10" />

The default system value is 10


The lists are all ordered by the "_updateddate desc" .i.e the most recently updated is first


Multiple workflow support

To enable multiple workflow support copy the "newGenericEntity.aspx" file and rename. In our example we rename this to be "newcases1.aspx".

Create settings in CRM as follows:

   <add key="FullFileName_WorkflowName" value="Another case workflow"/>
   <add key="FullFileName_WFState" value="New case state II"/>
   <add key="FullFileName_NewPageHint" value="Custom hint"/>
   <add key="FullFileName_EntityName" value="Cases"/>
   <add key="FullFileName_EntryBlockName" value="CasesOfficeIntNew"/>
   <add key="FullFileName_AfterSavePage" value="SageCRMWS/intCases.aspx"/>
   <add key="FullFileName_BlockTitle" value="Cases"/>
   <add key="FullFileName_EntityWhere" value="Case_CaseId=-1"/>

EG

   <add key="newcases1.aspx_WorkflowName" value="Another case workflow"/>
   <add key="newcases1.aspx_WFState" value="New case state II"/>
   <add key="newcases1.aspx_NewPageHint" value="Custom hint"/>
   <add key="newcases1.aspx_EntityName" value="Cases"/>
   <add key="newcases1.aspx_EntryBlockName" value="CasesOfficeIntNew"/>
   <add key="newcases1.aspx_AfterSavePage" value="SageCRMWS/intCases.aspx"/>
   <add key="newcases1.aspx_BlockTitle" value="Cases"/>
   <add key="newcases1.aspx_EntityWhere" value="Case_CaseId=-1"/>


To customise the Accelerator menu you need to change the "SearchEntities" setting

   <add key="SearchEntities" value="Company,Person,Lead,Cases,Opportunity,Case Services Workflow,Cases Maintenance workflow"/>
   *To translate any caption you need to create a translation in CRM 
   EG
     capt_family='Accelerator'
     capt_code=’Opportunity’
     capt_us='Sales'
   *On the client then clear the cache for the translations to reload.

and add in new keys as follows in this example

   <add key="Cases Services workflowNewPage" value="SageCRMWS/newcase1.aspx" />
   <add key="Cases Maintenance workflowNewPage" value="SageCRMWS/newcase2.aspx" />

We must also set up the original entity settings (and set the _selectsql otherwise your quick search will not work)

 <add key="Case Services Workflow_table" value="cases"/>
 <add key="Case Services Workflow_selectsql" value="select top 5 * from cases where (case_description like '#searchsql#%' or case_referenceid like '#searchsql#%') and case_deleted is null"/>
 <add key="Case Services Workflow_sql" value="(case_description like '#searchsql#%' or case_referenceid like '#searchsql#%') and case_deleted is null"/>
 <add key="Case Services Workflow_id" value="case_caseid"/>
 <add key="Case Services Workflow_key" value="8"/>
 <add key="Case Services Workflow_summaryaction" value="sagecrmws/jump.asp"/>
 <add key="Case Services Workflow_summaryview" value="vCRMTogetherCase"/>
 <add key="Case Services Workflow_listfields" value="case_referenceid,case_description"/>
 <add key="Case Services Workflow_mailmergeview" value="vCRMTogetherCase"/>
 <add key="Case Services Workflow_descfield" value="case_description"/>
 <add key="Case Services Workflow_DataTableFields" value="case_referenceid,case_problemtype,case_description,case_problemnote"/>
 <add key="Case Services Workflow_FirstElement" value="case_referenceid"/>
 <add key="Case Services Workflow_subjectfields" value="Cases,case_referenceid"/>
 <add key="Case Services Workflow_codetag" value="false"/>
 <add key="Case Services Workflow_WorkflowName" value="Case Workflow"/>
 <add key="Case Services Workflow_WFState" value="Logged"/>
 <add key="Case Services Workflow_vsummary" value="vsummarycase"/>

note that the _summaryaction value is pointing to an ASP page which we set up as follows:

 var sURL=new String( Request.ServerVariables("URL")() + "?" + Request.QueryString );
 var caseid=Request.QueryString("case_caseid");
 var caseeurl=CRM.Url(281);
 caseeurl+="&Key8="+caseid;
 Response.Redirect(caseeurl);



You can configure the search functionality via the web.config file

Look for the setting

  <add key="entity_sql" value="field like '#searchsql#%' and prex_deleted is null"/>

EG

  <add key="company_sql" value="comp_name like '#searchsql#%' and comp_deleted is null"/>

change the value to have something like

  <add key="company_sql" value="(comp_name like '#searchsql#%' or comp_erpnumber like '#searchsql#%')and comp_deleted is null"/>

to search for an ERP number (as per this example)



CRMCodedPath setting

If your system does not allow http requests from with IIS to an outside address you can set the internal address within the web config

 <add key="CRMCodedPath" value="" />

sample value

 http://localhost/crm
  • requires CRM setting IPAddressChecking to be disabled – this is in the registry



  • build 4.2 (Oct 14)

You can add in quote and order lists to the company tab group "companyint"

 Custom File: = SageCRMWS/listQuotes.aspx?ctx=c
 Custom File: = SageCRMWS/listOrders.aspx?ctx=c



You can control how emails are filed (as emails (default) or editable communications) with the setting

 <add key="FileAsEmail" value="Y"/>

set this value to be "N" to turn off



Option to turn on Appt and task updates from outlook set to "Y" to turn on. Default of "Y"

 <add key="DisableApptTask" value="Y"/>



Option to default the attach email as file (outlook module). set to "Y" to turn on. Default of "N".

 <add key="AttachEmailFile" value="N"/>



All values in "entity_listfields" will display in the grid now.

-you must also set the "entity_DataTableFields" and "EmailQueryOffice71" to include the data field also

EG

<add key="company_DataTableFields" value="comp_name,comp_website"/>


  • Pre Jun 2015 (v4.3)

To Add multiple field values to the lists you need to create a composite field and alias it. To do this you need to use the "entity_selectsql" value (*any territory rules are ignored using this)

EG


 <add key="company_selectsql" value="select *, rtrim(comp_name) + ' ('+rtrim(isnull(comp_idcust,))+')'  as 'compdesc' from vSearchListCompany where comp_name like '#searchsql#%'  and comp_deleted is null"/>

and then set the value "compdesc" as the first field in the "entity_listfields" values

 <add key="company_listfields" value="compdesc,Comp_WebSite"/>

EG

 To add in multiple fields that lookup custom_captions and format dates you should create a new VIEW

In our example here we format the company created date and also get the comp_status translation from custom captions

 CREATE VIEW [dbo].[vSummaryCompanyCustom] AS 
 SELECT *, cc.Capt_US as comp_status_trans,
 convert(varchar, comp_createddate, 104) as comp_createddate_trans
 from vSummaryCompany
  LEFT JOIN Custom_Captions cc ON comp_status = Capt_Code AND capt_familytype='choices'  
 GO

Our setting changes to

 <add key="company_table" value="company,vSummaryCompanyCustom" />
 <add key="company_listfields" value="comp_name,comp_status_trans,comp_createddate_trans"/>

Ignore domains (outlook integration) * Update 4.3 May 2015

New option TotalIgnoreDomains to ignore certain domains (comma separated) EG

       <add key="TotalIgnoreDomains" value="@hotmail.com,@gmail.com,@yahoo.com" />
   -->
   <add key="TotalIgnoreDomains" value="@none.com" />

The screens in Accelerator are CRM screens and can be customized the same way (Administration -> Customization -> Entity -> Screens).

The format is

 EntityOfficeInt

and

 EntityOfficeIntNew

and

 EntityOfficeIntSmall
  • Entity is Cases/Company/Person etc



If you want to change the tag on opportunity to be like cases

 <add key="cases_subjectfields" value="Cases,case_referenceid"/>
 <add key="cases_codetag" value="false"/>

Change

 <add key="opportunity_subjectfields" value="Opportunity,oppo_opportunityid"/>
 <add key="opportunity_codetag" value="true"/> 

To be

 <add key="opportunity_subjectfields" value="Opportunity,oppo_customfieldName"/>
 <add key="opportunity_codetag" value="false"/>

If you wish to code the tags you use the id field and the codes map as follows

 "Lead":"AA";
 "Cases":"BB";
 "Company":"NN";
 "Person":"II";
 "Opportunity":"YY";
 ",":"X";
 "1":"M";
 "2":"D";
 "3":"Z";
 "4":"R";
 "5":"T";
 "6":"U";
 "7":"K";
 "8":"P";
 "9":"F";
 "0":"L";

So for Opportunityid = 14782

The code would be

 #YYXMRKPD#

And unencoded

 #Opportunity,14782#



Email search matching

This is controlled by the SQL in the web.config

EG Lead matching

   <add key="EmailQueryOfficeLead" value="select top 25 lead_leadid, lead_companyname,lead_personlastname, lead_description from lead with(nolock) where lead_deleted is null and lead_personemail='#searchsql#'"/>

so to disable this you could add in some SQL to always eval to false...EG " 1=2 and "

  <add key="EmailQueryOfficeLead" value="select top 25 lead_leadid, lead_companyname,
            lead_personlastname, lead_description from lead with(nolock) 
            where 1=2 and 
             lead_deleted is null and lead_personemail='#searchsql#'"/>


The search on the email is controlled by

<add key="EmailQuery71" value="SELECT DISTINCT v.Comp_CompanyId, v.Pers_PersonId, e.ELink_Type AS 'emai_type',

                          e.Emai_EmailAddress FROM vAllEmail e with(nolock), vSummaryPerson v with(nolock)
                           WHERE e.ELink_EmailId = e.Emai_EmailId AND e.ELink_RecordID = v.Pers_PersonId AND 
                           ((e.Emai_EmailAddress) LIKE '%#searchsql#%')"/>

Based on this SQL you can create indexes in SQL to speed up results.




To disable searching on Leads (from a search box and not from outlooks email matching) (if you don't use the lead entity for example) you can do this by updating the SQL used on the search

The lead SQL (in web.config) looks like the following

  <add key="lead_sql" value="( ((rtrim(lead_personfirstname) + ' ' +rtrim(lead_personlastname)) like '#searchsql#%') or lead_companyname like '#searchsql#%' or lead_personlastname like '#searchsql#%' or lead_personfirstname like '#searchsql#%')"/>

and you could update to be

  <add key="lead_sql" value=" 1=2 and ( ((rtrim(lead_personfirstname) + ' ' +rtrim(lead_personlastname)) like '#searchsql#%') or lead_companyname like '#searchsql#%' or lead_personlastname like '#searchsql#%' or lead_personfirstname like '#searchsql#%')"/>

Note that we added in " 1=2 and " to the SQL so the SQL will immediately evaluate to no results



Setting defaults on date/time fields

Add the field to the NEW screen and add the following code into the create script

 var xdate=new Date();
 var _m=xdate.getMonth()+1;
 var _y=xdate.getFullYear();
 var _d=xdate.getDate();
 var _mm=xdate.getMinutes();
 var _hh=xdate.getHours();
 DefaultValue = _d+'/'+_m+'/'+_y+' '+_hh+':'+_mm;
  • You may need to swicth the day and month values around depending on your local date time settings



Defaults for library records can be set by editing the following key values in the web.config file

  • Please note that the value must be the code and not the translation
 <add key="libr_category" value="Sales"/>
 <add key="libr_status" value="Final"/>
 <add key="libr_type" value="Proposal"/>



To display a translation in the search grid (in the outlook task pane) you must do the following:

Create a new view EG

drop view [vSummaryCompanyCustom] go CREATE VIEW [dbo].[vSummaryCompanyCustom] AS

SELECT comp_companyid, comp_name,comp_status, cc.Capt_DE as comp_status_trans,
convert(varchar, comp_createddate, 104) as comp_createddate_trans
from vSummaryCompany
 inner JOIN Custom_Captions cc ON comp_status = cc.Capt_Code 
 where Capt_Family='comp_status'
GO
  • Not that the view links to the custom_captions table

update web.config

   <add key="company_table" value="company,vSummaryCompanyCustom"/>
   <add key="company_listfields" value="comp_name,comp_status_trans"/>
   <add key="company_DataTableFields" value="Comp_Name,comp_status_trans"/>

Restart outlook to test



User Select fields (setting default user) On a NEW screen you might want to set a case to be assigned to the company account manager.

To do this you first must open the field (EG case_assigneduserid) and set the default to be

 No Default
  • there is a trade off here so in that you may lose the current user from being set. I would also then recommend that you set the field to be required.

The in the screen-field createscript you can set the DefaultValue EG

 DefaultValue=CRM.GetContextInfo("company","comp_primaryuserid");



To edit the NEW menu the "NewEntities" option is available

 <add key="NewEntities" value="Company,Person,Cases,Opportunity,Lead" />

User Lookups in Accelerator Screens

These can be configured using the following setting

  <add key="userlookupsql" value="select user_userid, user_fullname from vusers where user_disabled is null order by user_firstname" />