Accelerator Customisation: Difference between revisions

From Accelerator for SageCRM
No edit summary
No edit summary
Line 119: Line 119:


*Warning: we do not recommend this setting as different regions send the date differently and can cause issues.
*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 requiring 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.");
      }
    }

Revision as of 09:23, 20 February 2013

  • 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 ehe 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 "Y" to turn on. Default value is "N"

   <add key="UseEmailDatetime" value="N" />
  • 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 requiring 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.");
     }
   }