Sage CRM Developers Course

Slides:



Advertisements
Similar presentations
Sage CRM Developers Course
Advertisements

Design Validation CSCI 5801: Software Engineering.
Session 2Introduction to Database Technology Data Types and Table Creation.
1.NET Web Forms DataGrid © 2002 by Jerry Post. 2 Data Grid Has Many Uses  The grid uses HTML tables to display multiple rows of data. It is flexible.
Sage CRM Developers Course
Sage CRM Developers Course Entities and the Data Model (Part 2)
Advantage Data Dictionary. agenda Creating and Managing Data Dictionaries –Tables, Indexes, Fields, and Triggers –Defining Referential Integrity –Defining.
Guide to Oracle10G1 Introduction To Forms Builder Chapter 5.
A Guide to Oracle9i1 Introduction To Forms Builder Chapter 5.
Fundamentals, Design, and Implementation, 9/e Chapter 11 Managing Databases with SQL Server 2000.
ASP.NET Database Connectivity I. 2 © UW Business School, University of Washington 2004 Outline Database Concepts SQL ASP.NET Database Connectivity.
Fundamentals, Design, and Implementation, 9/e Chapter 7 Using SQL in Applications.
Performed by:Gidi Getter Svetlana Klinovsky Supervised by:Viktor Kulikov 08/03/2009.
Database Design Concepts INFO1408 Term 2 week 1 Data validation and Referential integrity.
ASP.NET Programming with C# and SQL Server First Edition Chapter 8 Manipulating SQL Server Databases with ASP.NET.
Chapter 14: Advanced Topics: DBMS, SQL, and ASP.NET
Sage CRM Developers Course
Database Design Concepts Info 1408 Lecture 2 An Introduction to Data Storage.
Access Lecture 1 Database Overview and Creating Tables Create an Employee Table.
1 Nassau Community CollegeProf. Vincent Costa Acknowledgements: Introduction to Database Management, All Rights ReservedIntroduction to Database Management.
Chapter 4 Relational Databases Copyright © 2012 Pearson Education 4-1.
Sage CRM Developers Course Programming for the Advanced Manager.
Phonegap Bridge – File System CIS 136 Building Mobile Apps 1.
Phil Brewster  One of the first steps – identify the proper data types  Decide how data (in columns) should be stored and used.
Databases & Data Warehouses Chapter 3 Database Processing.
Introduction To Databases IDIA 618 Fall 2014 Bridget M. Blodgett.
Sage CRM Developers Course
Sage CRM v7.2 Developers Course An Introduction to the Developer Program.
This presentation will guide you though the initial stages of installation, through to producing your first report Click your mouse to advance the presentation.
Sage CRM Developers Course
Module 3: Table Selection
Session 5: Working with MySQL iNET Academy Open Source Web Development.
INTERNET APPLICATION DEVELOPMENT For More visit:
SMART Agency Tipsheet Staff List This document focuses on setting up and maintaining program staff. Total Pages: 14 Staff Profile Staff Address Staff Assignment.
Classroom User Training June 29, 2005 Presented by:
Database Design for DNN Developers Sebastian Leupold.
Sage CRM Developers Course
Learningcomputer.com SQL Server 2008 – Entity Relationships in a Database.
RDB/1 An introduction to RDBMS Objectives –To learn about the history and future direction of the SQL standard –To get an overall appreciation of a modern.
Web Scripting [PHP] CIS166AE Wednesdays 6:00pm – 9:50pm Rob Loy.
Module 11: Programming Across Multiple Servers. Overview Introducing Distributed Queries Setting Up a Linked Server Environment Working with Linked Servers.
M1G Introduction to Database Development 2. Creating a Database.
ASP.NET The Clock Project. The ASP.NET Clock Project The ASP.NET Clock Project is the topic of Chapter 23. By completing the clock project, you will learn.
Christopher M. Pascucci.NET Programming: Databases & ADO.NET.
Enhancing Forms with OLE Fields, Hyperlinks, and Subforms – Project 5.
Sage CRM Developers Course Using the Component Manager.
Commercial RDBMSs Access and Oracle. Access DBMS Architchecture  Can be used as a standalone system on a single PC: -JET Engine -Microsoft Data Engine.
Sage CRM Developers Course
3 Copyright © 2004, Oracle. All rights reserved. Working in the Forms Developer Environment.
6 Copyright © 2009, Oracle. All rights reserved. Using the Data Transformation Operators.
Physical Database Design Purpose- translate the logical description of data into the technical specifications for storing and retrieving data Goal - create.
Constraints Lesson 8. Skills Matrix Constraints Domain Integrity: A domain refers to a column in a table. Domain integrity includes data types, rules,
Session 1 Module 1: Introduction to Data Integrity
What is MySQL? MySQL is a relational database management system (RDBMS) based on SQL (Structured Query Language). First released in January, Many.
IS2803 Developing Multimedia Applications for Business (Part 2) Lecture 1: Introduction to IS2803 Rob Gleasure
CP476 Internet Computing Perl CGI and MySql 1 Relational Databases –A database is a collection of data organized to allow relatively easy access for retrievals,
The Power of Sage CRM 5.8 Jeff Richards Education and Development Program Manager Sage Technologies Dublin
Starting with Oracle SQL Plus. Today in the lab… Connect to SQL Plus – your schema. Set up two tables. Find the tables in the catalog. Insert four rows.
Copyright © 2007, Oracle. All rights reserved. Managing Items and Item Catalogs.
 CONACT UC:  Magnific training   
Sagecrm.com Sage CRM An Introduction to the Developer Program.
Agenda for Today  DATABASE Definition What is DBMS? Types Of Database Most Popular Primary Database  SQL Definition What is SQL Server? Versions Of SQL.
ASP.NET Programming with C# and SQL Server First Edition
Database Fundamentals
Teaching slides Chapter 8.
Advanced SQL: Views & Triggers
Chapter 7 Using SQL in Applications
Relational Database Design
Data Definition Language
Chapter 11 Managing Databases with SQL Server 2000
Presentation transcript:

Sage CRM Developers Course Entities and the Data Model (Part 1)

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 Email 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)

Agenda How data and record identity is handled Record Object vs. SQLQuery Object Role of Stored Procedures Allowed Database Changes Meta Data and Physical Data Types New Tables and Fields in CRM Linking to External Database tables How and where table data is stored in Meta Data

How data and record identity is handled Record Object vs SQLQuery Object Role of Stored Procedures

New Sage CRM v7.2 Installs on MS SQL Server use SQL Identity Columns In Sage CRM v7.1 and earlier Primary Key values were generated and maintained by stored procedures. This was to create common method mechanism between main install and SOLO. SOLO dropped in favour of new Mobile Apps New installs on SQL Server will now use SQL Identities Significant performance improvements New version of Stored Procedure for existing installs NO Change for Oracle

New Installs on MS SQL Server use SQL Identity Columns SELECT t.TABLE_NAME ,c.COLUMN_NAME FROM INFORMATION_SCHEMA.COLUMNS AS c JOIN INFORMATION_SCHEMA.TABLES AS t ON t.TABLE_NAME = c.TABLE_NAME WHERE COLUMNPROPERTY(OBJECT_ID(c.TABL E_NAME) ,c.COLUMN_NAME,'IsIdentity') = 1 AND t.TABLE_TYPE = 'Base Table'

eWare_get_identity_id stored procedure use in QueryObject code Problems will arise with add-on code that does a direct insert using eware_get_identity_id in Query object. ‘hidden’ or automatic rules within CRM Validation Rules Table Level Scripts ASP and .NET Application Extensions Record object not effected

Inserts using QueryObject Sage CRM v7.1 var strSQL = "DECLARE @ret int"; strSQL += "EXEC @ret=eware_get_identity_id 'cases'"; strSQL += "INSERT cases"; strSQL += "(case_caseid, Case_Description, Case_PrimaryCompanyId)"; strSQL += "VALUES (@ret, 'abc',10)"; var myQuery = CRM.CreateQueryObj(strSQL,""); myQuery.ExecSQL() Sage CRM v7.2 var strSQL = "INSERT INTO Cases"; strSQL += "(Case_Description, Case_PrimaryCompanyId)"; strSQL += "VALUES ('abc',10)")"; NOTE: Upgraded Systems will still use old ID mechanism.

Oracle and Inserts No equivalent stored procedure in Oracle so there is no safe way of getting ids directly. SEQUENCES are used to control the identities. Sequence created in the CRM database for each table with the name TablePrefix_SEQUENCE Eg comp_sequence, pers_sequence etc. Cases and CaseProgress share the same sequence as do Opportunity and OpportunityProgress. Next value from a sequence obtained by calling the NextVal function of the sequence. Returns the next val and increments the sequence. SELECT Comp_Sequence.NextVal from DUAL; NOTE: Does not take into account the rep_ranges table, and therefore is not advised SOLO allocates Ranges to client machines Held in Rep_ranges table. When not using API object you will need to check that data is not going out of range. The process is as follows Look up Range_RangeStart and Range_RangeEnd in Rep_Ranges where Range_TableID is the identifier of the table. TableID is 5 for the Company table. Call SELECT Comp_Sequence.NEXTVAL FROM DUAL to get the next sequence number. If the sequence range is outside the range found in step 1 (which it will be because you dropped the sequence and recreated with a sequence start of 1), then assume that this range has been filled up, so move to the next available range. Ranges are allocated in blocks of 50000, so the first range is 8001 to 58000, the second range is 58001 to 108000, the third range is 108001 to 158000, and so on. Problems may arise if more than 1 process is trying to allocate a new range at the same time. NOTE: Do not run process when CRM is running. NOTE: Accessing the ranges table at the back end is not supported.

CRM Components & Database Type System Variables available in component allows the Install to be checked. Write components to accommodate database type. //iDatabase - returns the current installed database. // Constants returned // ISQLServer // IOracle // e.g. // if (iDatabase == IOracle) // { // //Do this; // } sViewText="CREATE VIEW vMyPhone AS SELECT"; if (iDatabase == IOracle) { sViewText = sViewText + " Phon_CountryCode || N ' ' ||Phon_AreaCode || N ' ' || Phon_Number"; } else sViewText = sViewText + "RTRIM(ISNULL(Phon_CountryCode, '')) + ' ' +RTRIM(ISNULL (Phon_AreaCode, '')) + ' ' + RTRIM(ISNULL(Phon_Number, ''))"; sViewText = sViewText + " AS Phon_FullNumber, Phone.* FROM Phone "; sViewText = sViewText + ", Custom_Captions WHERE LOWER (TRIM(Phon_Type))= LOWER(TRIM(Capt_Code(+))) AND"; sViewText = sViewText + "LEFT JOIN Custom_Captions ON Phon_Type = Capt_Code WHERE"; sViewText = sViewText +" Phon_Deleted IS NULL"; AddView("vMyPhone", "Phone", "This selects all of the phone numbers", sViewText, false, false, false, false, false);

Allowed Database Changes Meta Data and Physical Data Types Allowed Database Changes

Business Rules in Database CRM makes use of physical data types but meta data ‘adds value’ Custom_edits See Developer Guide reference for discussion of EntryBlock.EntryType property in API CRM DOES NOT use constraints within database. When installing CRM the only SQL rule that is written into the tables structure is whether the Primary Key column is NOT NULL. All constraints implemented in application layer.

CRM FieldTypes & SQL Server Datatypes Product int IntelligentSelect nvarchar Multiselect DateOnly Datetime Currency Numeric Currency_CID Int SearchSelectAdvanced Minutes CurrencySymbols Text StoredProc Checkbox PhoneNumber MultilineText ntext emailaddress WWWURL Selection UserSelect TeamSelect Integer numeric DateTime datetime

How and where table data is stored in Meta Data

Meta Data Definitions of Tables Custom_Databases Manages all the connections to remote databases All passwords encrypted using encryption algorithms All database connections are opened at the first CRM logon Custom_Tables Bord_WebServiceTable enables extra objects to be exposed to the WSDL Custom_Edits EntryType controls how the system displays fields EntrySize controls how many characters can be entered on screen (can be changed, but must be <= column width) Colp_System may cause fields not to appear for selection. You can undo this, but be careful Custom_Views The whole system uses views to display data Views should be maintained from within the CRM system, never from SQL Server SQLLite relevant for SOLO only Custom_Table bord_tableid 1 Address 2 CaseProgress 3 Cases 4 Communication 5 Company 6 Email 7 Library 8 Marketing 9 Notes 10 Opportunity 11 OpportunityItem 12 OpportunityProgress 13 Person 14 Phone 15 Products 17 Team CRM database used to store business data and metadata. Business Data: Implementation specific data such as company, person, links, etc. Metadata: Base configuration for the CRM system. Generic drop-downs and custom screen captions, screen structures, lists etc. Meta Data Dictionary Automatically Maintained Tables Custom_captions Controls Captions for Buttons, Images, Tabs, Error Messages, System Messages, Drop downs Also controls Links (Address Types, Person Types) Controls tab / dropdown order Person Relationship Types Captions default to US values (not the capt_code value) if one exists Out of the box, there are about 7000 strings Custom_ContainerItems Primary Use is for storing the users dashboard layouts and contents Custom_Databases Manages all the connections to remote databases All passwords encrypted using the new 5.8 encryption algorithms All database connections are opened at the first CRM logon Custom_Edits EntryType controls how the system displays fields EntrySize controls how many characters can be entered on screen (can be changed, but must be <= column width) Colp_System may cause fields not to appear for selection. You can undo this, but be careful Custom_EmailAddress Stores the email manager mailbox addresses being monitored Stores the email aliases for sending email from CRM Custom_Lists Showselectasgif displays an icon Custom_ReportBands Custom_ReportCharts Controls the charts Some fields not exposed through UI e.g. rotation, size, but can be used Custom_ReportFavourites Controls users favourite reports Ordered alphabetically on screen Custom_ReportFields Custom_ReportGroups Custom_Reports Custom_ReportSearches Custom_RuleSets Used for the mail manager rules Custom_ScreenObjects Defines the screens in the application Custom_Screens Defines the structure of almost all screens in the application Custom_Scripts Used for maintaining all user defined table and entity level scripts Custom_Tables Bord_WebServiceTable enables extra objects to be exposed to the WSDL Custom_Sysparams Contains many system settings that control system behaviour Parm_Name and Parm_Value are the two relevant columns Custom_Tabs Controls all the tab layouts in the application The main menu and administrator left hand frames are also tab groups Custom_Views The whole system uses views to display data Views should be maintained from within the CRM system, never from SQL Server SQLLite relevant for SOLO only

Basic Table Description CREATE TABLE [dbo].[MyTable]( [mytb_mytableid] [int] NOT NULL, [mytb_CreatedBy] [int] NULL, [mytb_CreatedDate] [datetime] NULL, [mytb_UpdatedBy] [int] NULL, [mytb_UpdatedDate] [datetime] NULL, [mytb_TimeStamp] [datetime] NULL, [mytb_Deleted] [int] NULL, [mytb_Secterr] [int] NULL, [mytb_Workflowid] [int] NULL, [mytb_Description] [nchar](30)) Create externally and then link Not able to become full entity Create table via interface Advanced Customization Wizard. Entity Wizard All Ids managed by CRM Tabl_Secterr for primary entities only, enforces security on that entity. Security is discussed more later in the course New Table and Field definition will be in custom_tables and custom_edits

Problems Problems occur if developer introduces Database constraints Foreign key constraints Checks Other changes such as identity columns.

Holding Data in CRM New Columns in Tables Rows as Columns Adding columns to Entities, Company, Person, etc Marketing table for Company and Person Rows as Columns Key Attribute Data DD tables Target List technique for SQL Logs for use in screens Data Sets User_settings Custom_sysparams

Columns versus Datasets Most data is held within a table within columns E.g. User_userid, user_lastname, user_firstname. Some instances of using Datasets (or rows) to model attributes User Preferences Held in the usersettings table as a record set E.g. To find a users timezone preference you would have to look in the usersettings table. Custom_sysparams Hold system settings

Datasets and Customizations Can only use simple meta data definitions for screens where data is within a single row. Consider Company Summary Screen and Companyboxlong Addressboxshort personboxshort Require Advanced Customization for Screens and Lists for Phone/Email screens Custom_sysparams User_settings Key Attribute Profiling Examples of creating screens not based on single rows are covered in later part of the course

Q&A

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 Email 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)

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