Accelerator Customisation

From Accelerator for SageCRM
Revision as of 09:10, 8 June 2015 by Sagecrmw (talk | contribs)
  • 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.



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 and Word 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"/>



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"/>

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

   <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"/>



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"/>