Presentation is loading. Please wait.

Presentation is loading. Please wait.

Sage CRM Developers Course

Similar presentations


Presentation on theme: "Sage CRM Developers Course"— Presentation transcript:

1 Sage CRM Developers Course
Using the API Objects in ASP Pages (1)

2 Looking ahead to the classes
DP01: Introduction to the Development Partner Program DP02: Entities and the Data Model (Part 1 of 2) DP03: Entities and the Data Model (Part 2 of 2) DP04: Implementing Screen Based Rules (Part 1 of 2) DP05: Implementing Screen Based Rules (Part 2 of 2) DP06: Screen and User Independent Business Rules DP07: Workflow (Part 1 of 2) DP08: Workflow (Part 2 of 2) DP09: Using the API Objects in ASP Pages (Part 1 of 2) DP10 : Using the API Objects in ASP Pages (Part 2 of 2) DP11: Using the Component Manager DP12: Programming for the Advanced Manager DP13: Using the Web Services API DP14: Using the Web Services API (Part 2 of 2) DP15: Coding the Web Self Service COM API (Part 1 of 2) DP16: Coding the Web Self Service COM API (Part 2 of 2) DP17: Using the .NET API (Part 1 of 2) DP18: Using the .NET API (Part 2 of 2)

3 Agenda Using the API objects in ASP Pages Linking to External Databases Extending the Data Model Basic Data Handling within an ASP Page Listing Data Editing Data Adding Data

4 Creating a Page We need to build a page that lists all companies that the user manages. Call the tab 'My Accounts'. 1) Add Tab and call page that lists all companies. Call the page 'companylist.asp' Build a new List Block. Call the ListBlock 'customcompanylist' and base it on the vCompany view Include the columns Status Company Name Segment Number Employees Each column must be sortable. Explain the eware.js file.

5 Standard include files
sagecrm.js reference in JavaScript-based ASP pages. This file sets the default language to JavaScript. (Default for Sage CRM v7.x) sagecrmnolang.js this file does not set the default language. (Default for Sage CRM v7.x) accpaccrm.js reference in JavaScript-based ASP pages. This file sets the default language to JavaScript. accpacnolang.js this file does not set the default language. ewaress.js reference in JavaScript-based, Self Service ASP pages.

6 sagecrmnolang.js file CRM = Server.CreateObject("eWare.CRM"); eMsg = CRM.Init( Request.Querystring, Request.Form, Request.ServerVariables("HTTPS"), Request.ServerVariables("SERVER_NAME"), false, Request.ServerVariables("HTTP_USER_AGENT"), Accept);

7 Developer Include Files
Received when DP joins program. sagecrmdpp.js Sagecrmnolangdpp.js sagecrmdpp.vbs accpaccrmdpp.js accpaccrmnolangdpp.js accpaccrmdpp.vbs Include the appropriate files in your third-party products/installs. These files are supplied to CRM Development Partners only. They will enable your product to run on the CRM installs that do not have the Enterprise Integration Server (EIS). Products using the standard accpaccrm.js will not run on systems without EIS.

8

9 Connecting to an external Database
Making a permanent database connection Making a 3rd Party table work like a CRM table select * from custom_databases Adding a ‘Spanned’ table Columns existing in CRM database table and external database E.g. CRM management columns like Workflowid exist in CRM with foreign key to external table.

10 New Entities Full Customization of new screens, lists and views Full use of field and table level scripts Governed by Security Territories Workflow can be built Automatic System Policing of insert by, update by and timestamps Available for reporting and target lists CREATE TABLE [dbo].[Project] ( [PROJ_ProjectId] [int] IDENTITY (1, 1) NOT NULL , [PROJ_PrimaryCompanyId] [int] NULL , [PROJ_PrimaryPersonId] [int] NULL , [PROJ_AssignedUserId] [int] NULL , [PROJ_ChannelId] [int] NULL , [PROJ_Description] [char] (40) NULL , [PROJ_CreatedBy] [int] NULL , [PROJ_CreatedDate] [datetime] NULL , [PROJ_UpdatedBy] [int] NULL , [PROJ_UpdatedDate] [datetime] NULL , [PROJ_TimeStamp] [datetime] NULL , [PROJ_Deleted] [tinyint] NULL , [PROJ_SegmentID] [int] NULL , [PROJ_SecTerr] [int] NULL , [PROJ_WorkflowId] [int] NULL )

11 ASP Example Screenflow

12 New Entity Tasks Create New Project Table
Must have core columns as discussed in documentation Link new project table to CRM. Add additional columns to create relationships Create screens entityWebPicker entityDetailBox entitySearchBox entityTopContent Create a view that will exclude deleted entities. e.g. select * from project where proj_deleted is null Create lists with appropriate hyperlinks entitylist entitygrid If list calls proj_status "selection as gif" add folder and images Create calls to asp pages from menus Admin>Customization>System>find Admin>Customisation>System>new Create Tab bar for new entity(with same name as entity) Project Create asp pages projectnew.asp projectsummary.asp projectfind.asp projectlist.asp Create workflow project workflow

13 Naming Conventions Suggested Naming Convention for new Entity Blocks
Screens entityWebPicker entityDetailBox entitySearchBox entityTopContent Lists entityGrid entityList ASP pages entityFind.asp entityNew.asp entitySummary.asp entityUser.asp entityEntity.asp (for listing children of new entity from entities tab bar)

14 Typical Tasks Create a List Page Create an Insert Page Create an Edit Page Handling deletes Create a Search Page

15 List Page Structure var myBlock = CRM.GetBlock('opportunitylist'); var myRecordId = CRM.GetContextInfo('company','comp_companyid'); var Arg = 'oppo_primarycompanyid='+myRecordId CRM.AddContent(myBlock.Execute(Arg)); Response.Write(CRM.GetPage());

16 Edit Page Structure var myBlock = CRM.GetBlock('OpportunityDetailBox'); var myRecordId = CRM.GetContextInfo('Opportunity','oppo_opportunityid'); //var myRecordId = Request.QueryString('oppo_opportunityid'); var myRecord = CRM.FindRecord('Opportunity','oppo_opportunityid='+myRecordId); CRM.AddContent(myBlock.Execute(myRecord)); Response.Write(CRM.GetPage());

17 Adding Buttons //Example to call an inbuilt CRM action e.g 130 is find company var strFindCompanyButton = CRM.Button('search','search.gif', CRM.Url(130)); //Example to call a Custom ASP page var strCallASPButton = CRM.Button('ASP','save.gif', CRM.Url('myPage.asp')); //Example to show control of buttons display on screen using entity security //The following button is only available for users with insert rights on company entity (see security) var strNewCompanySecurityButton = CRM.Button('New','newcompany.gif', CRM.Url(1200),'COMPANY','INSERT'); //Example to show how to build a custom help button var helpFile = "FI_SearchingForCompany.htm"; var strCustomHelpButton =CRM.Button("Help", "help.gif", "javascript:window.open('/"+sInstallName+"/help/EN/Main Menu/Default_CSH.htm#User/"+helpFile+"', 'HELPWIN','scrollbars=yes,toolbar=no,menubar=no,resizable=yes,top=200, width=600,height=400');"); re = /href/gi; strCustomHelpButton = strCustomHelpButton.replace(re, "onclick"); myBlock.AddButton(strFindCompanyButton); myBlock.AddButton(strCallASPButton); myBlock.AddButton(strNewCompanySecurityButton); myBlock.AddButton(strCustomHelpButton);

18 Add Page Structure if(CRM.Mode ==View) { CRM.Mode = Edit; } var myBlock = CRM.GetBlock('opportunitydetailbox'); var myRecord = CRM.CreateRecord('Opportunity'); myRecord.oppo_stage= 'Lead'; myRecord.oppo_status= 'In Progress'; myRecord.oppo_primarycompanyid= CRM.GetContextInfo('Company','comp_companyid'); myRecord.oppo_primarypersonid= CRM.GetContextInfo('person','pers_personid'); CRM.AddContent(myBlock.Execute(myRecord)); Response.Write(CRM.GetPage()); if(CRM.Mode == Save) Response.Redirect(CRM.URL('customoppolist.asp'))

19 Q&A

20 Looking ahead to the classes
DP01: Introduction to the Development Partner Program DP02: Entities and the Data Model (Part 1 of 2) DP03: Entities and the Data Model (Part 2 of 2) DP04: Implementing Screen Based Rules (Part 1 of 2) DP05: Implementing Screen Based Rules (Part 2 of 2) DP06: Screen and User Independent Business Rules DP07: Workflow (Part 1 of 2) DP08: Workflow (Part 2 of 2) DP09: Using the API Objects in ASP Pages (Part 1 of 2) DP10 : Using the API Objects in ASP Pages (Part 2 of 2) DP11: Using the Component Manager DP12: Programming for the Advanced Manager DP13: Using the Web Services API DP14: Using the Web Services API (Part 2 of 2) DP15: Coding the Web Self Service COM API (Part 1 of 2) DP16: Coding the Web Self Service COM API (Part 2 of 2) DP17: Using the .NET API (Part 1 of 2) DP18: Using the .NET API (Part 2 of 2)

21 Visit the Sage CRM Ecosystem at www.sagecrm.com
Facebook: Sage CRM Twitter: wwwsagecrmcom LinkedIn: Sage CRM (Official Group) YouTube: wwwsagecrmcom


Download ppt "Sage CRM Developers Course"

Similar presentations


Ads by Google