Accelerator Custom Entities

From Accelerator for SageCRM

Accelerator allows you to add in custom Primary entities.

Our testing assumed that the entity was setup using the entity wizard.

Here are the steps

1. Open the web.config file for editing(located in CustomPages/SageCRMWS/)

2. Add in the search entity ...we will use an entity call Jobs here.

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

3. Add in the key values (this is a subset..the full set can be seen in the web.config file for the default entities)

              <add key="jobs_table" value="Jobs"/>
              <add key="jobs_sql" value="( job_description like '#searchsql#%') and pers_deleted is null"/>
              <add key=" jobs_id" value=" jobs_jobid"/>
              

Re-start Outlook to test.

You may also need to clear the cache on the client side toolbars to see the results.

Here is a complete "Project" entity (created with the Entity Wizard) integration example

               <add key="project_table" value="project"/>
               <add key="project_selectsql" value=""/>
               <add key="project_sql" value="proj_name like '#searchsql#%'  and proj_deleted is null"/>
               <add key="project_id" value="proj_projectid"/>                
               <add key="project_summaryview" value="project"/>
               <add key="project_listfields" value="proj_name,proj_status"/>
               <add key="project_mailmergeview" value="project"/>
               <add key="project_descfield" value="proj_name"/>
               <add key="project_DataTableFields" value="proj_name,proj_status"/>
               <add key="project_FirstElement" value="proj_name"/>
               <add key="project_subjectfields" value="Project,proj_projectid"/>
               <add key="project_codetag" value="false"/>
               <add key="project_WorkflowName" value=""/>
               <add key="project_WFState" value=""/>

The following kets are not used for custom entities

               <add key="project_key" value="1"/>
           

Add this setting if you wish to create your own page. Any custom page would have to cope with how the context is sent into the page (via the querystring) and this differs from how Sage CRM itself does this

                <add key="projectSummaryPage" value="Project/ProjectSummary.asp"/>
                <add key="projectNewPage" value="DemoEnt/demoent_New.asp"/>

Note that this value must be false

               <add key="project_codetag" value="false"/>
    • The system will automatically use default page(s) for New/Summary as these are located in
   custompages/sagecrm/component/crment_New.asp

and

   custompages/sagecrm/component/crment_Summary.asp


You can copy these and edit as required.

One limitation of custom entities is passing in context from the Main entities (as these are ASPX pages and the sessions don't cross over to ASP).



If you are customizing the communication related entity and are using the Appointment/Task push to CRM then you will need to edit the view(s) to have this work still.

In the example below we have a custom entity called contracts and an id field 'Comm_ContractsId' for that. We edit the view 'vCRMTogetherPerComm'

EG ==

ALTER VIEW [dbo].[vCRMTogetherPerComm] AS 
select pers_personid as 'cmli_comm_personid',   
pers_companyid as 'cmli_comm_companyid', null as 'comm_opportunityid'  
, null as 'Comm_ContractsId'
,null as 'comm_caseid', null as 'comm_orderid', null as 'comm_quoteid',pers_SecTerr,    
Pers_CreatedBy,Pers_PrimaryUserId  from vperson 
GO

Note that we added in

 null as 'Comm_ContractsId'