sage crm developers course using the.net api (2)

Download Sage CRM Developers Course Using the.NET API (2)

Post on 24-Dec-2015

221 views

Category:

Documents

5 download

Embed Size (px)

TRANSCRIPT

  • Slide 1
  • Sage CRM Developers Course Using the.NET API (2)
  • Slide 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 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)
  • Slide 3
  • Agenda The Specialised Classes ListPage DataPage DataPageEdit DataPageDelete DataPageNew SearchPage Workflow using the.Net API Customizing the Specialised Classes Programmatic Control of Screens Building Complex Pages Controlling Screen Positioning
  • Slide 4
  • The Specialised Classes
  • Slide 5
  • ListPage
  • Slide 6
  • using System; using System.Collections.Generic; using System.Text; using Sage.CRM.WebObject; namespace crm72a { public class OppoListPage : ListPage { public OppoListPage() : base("opportunity", "opportunitylist", "opportunityfilterbox") { FilterByField = "oppo_assigneduserID"; FilterByContextId = (int)Sage.KeyList.UserId; }
  • Slide 7
  • DataPage
  • Slide 8
  • using System.Collections.Generic; using System.Text; using Sage.CRM.WebObject; using Sage.CRM.Data; namespace crm72a { public class myDataPage : DataPage { public myDataPage() : base("company", "comp_companyid", "companyboxshort") { this.UseEntityTabs = true; this.UseWorkflow = true; this.EditMethod = "RunDataPageEdit"; this.ContinueMethod = "RunListPage"; } Allows complex screens to be built using simple DataPage class
  • Slide 9
  • DataPageEdit
  • Slide 10
  • using System.Collections.Generic; using System.Text; using Sage.CRM.WebObject; namespace myProject { public class myClass : DataPageEdit { /* Constructor needs EntityName, IdField and ScreenName */ public myClass() : base("xxxxTableName", "xxxx_fieldname", "xxxxScreenName") { this.UseEntityTabs = true; this.UseWorkflow = true; this.CancelMethod = "RunListPage"; this.DeleteMethod = "RunDataPageDelete"; this.SaveMethod = "RunDataPage"; } } }
  • Slide 11
  • DataPageDelete
  • Slide 12
  • using System.Collections.Generic; using System.Text; using Sage.CRM.WebObject; namespace myProject { public class myClass : DataPageDelete { /* If inherited from DataPageDelete then just need to set the EntityName, IdField and ScreenName */ public myClass() : base("xxxxTableName", "xxxx_fieldname", "xxxxScreenName") { this.CancelMethod = "RunListPage"; this.DeleteMethod = "RunDataPage"; }
  • Slide 13
  • DataPageNew
  • Slide 14
  • using System.Collections.Generic; using System.Text; using Sage.CRM.WebObject; using Sage.CRM.Controls; using Sage.CRM.Data; namespace myProject { public class myClass : DataPageNew { public myClass() : base("xxxxTableName", "xxxx_fieldname", "xxxxScreenName") { this.SaveMethod = "RunDataPage"; this.UseWorkflow = true; this.WorkflowName = "Entity Workflow"; this.WorkflowState = "NewRecord"; } public override void AfterSave(EntryGroup screen) { /*Record recNewOppo = screen.getRecord; *recNewOppo.SetField("xxxxx_companyid", int.Parse(GetContextInfo("company", "comp_companyid"))); *recNewOppo.SetField("xxxxx_personid", int.Parse(GetContextInfo("company", "comp_primarypersonid"))); *recNewOppo.SaveChanges(); */ base.AfterSave(screen); } } }
  • Slide 15
  • SearchPage
  • Slide 16
  • using System.Collections.Generic; using System.Text; using Sage.CRM.WebObject; namespace myProject { public class myClass : SearchPage { /*if descended from SearchPage then you just need to set the * appropriate ListName and SearchBoxName */ public myClass() : base("xxxxSearchBoxName", "xxxxListName") { this.SavedSearch = true; /* ************* * Other objects available include: * * SearchScreen * ResultsGrid */ }
  • Slide 17
  • Search Screen Additional Components Saved Search available Keyword Search available Clear Button automatic in class Create New Group Requires additional custom coding by developer Actions Requires additional custom coding by developer
  • Slide 18
  • Workflow using the.Net API
  • Slide 19
  • Workflow in DataPages Controlled by properties of Specialised Classes DataPageBase UseWorkflow DataPage isWorkflowPostBack DataPageEdit WorkflowScreen DataPageNew WorkflowName WorkflowState
  • Slide 20
  • Calling Custom ASP and.NET Workflow Behaviour ASP pages and.NET assemblies may only be called by user driven rules (Primary, Transitional, Global) and may not be invoked by Escalation rules. Can either call ASP page or.NET assembly Workflow actions would be ignored Jscript conditions maybe used to control availability of rule
  • Slide 21
  • Customizing the Specialised Classes
  • Slide 22
  • Programmatic Control of Screens Adding Conditional Behaviour to a screen Controlling the display of data elements Adding and removing default buttons Adding Custom controls to screens Buttons and Hyperlinks (Save, Cancel, Help, Clear etc) Adding/Removing Fields from screens and lists Interacting with existing CRM information (TopContent and (recent) menus)
  • Slide 23
  • Sage.CRM.Controls The Sage.CRM.Controls namespace provides access to screen components to allow programmatic update of properties Entry Fields within a Meta Data defined screen EntryGroup Control of HTML returned and interaction with component Fields (Entry) GridCol Columns within a Meta Data defined list List Control of the HTML returned and interaction with component Columns (GridCol)
  • Slide 24
  • Interacting with the Screens When you call AddEntryGroup (c.f. DataPage) it stores up all the names of the entry groups that you have added in the array called EntryGroups Contains EntryGroup objects for each screen. Can reference EntryGroups array in BuildContents In ListPage can access ResultsGrid Screen Fields EntryGroup mygroup = EntryGroups[1]; Entry newE = mygroup.CreateEntry("oppo_createddate"); base.BuildContents(); List Columns for (int i = 0; i < ResultsGrid.Count; i++) { if (ResultsGrid[i].Name == "oppo_stage") { ResultsGrid[i].ShowHeading = false; break; }
  • Slide 25
  • Linking GridCols to ASP and.NET To link to an ASP page GridCol colOppoStatus = this.ResultsGrid[0]; colOppoStatus.JumpAction = 430; colOppoStatus.CustomActionFile = "CRMtest.asp"; colOppoStatus.CustomIdField = "oppo_opportunityid"; To call a CustomDotNet dll GridCol colOppoStatus = this.ResultsGrid[0]; colOppoStatus.JumpAction = 432; colOppoStatus.CustomActionFile = "CRMtest&dotnetfunc=RunOppoSummary"; colOppoStatus.CustomIdField = "oppo_opportunityid";
  • Slide 26
  • User Screen TopContent Custom Entity GetCustomEntityTopFrame("Project"); User Screen control HTMLString strFieldText = new HTMLString(" Custom Entity Information "); VerticalPanel panelFields = new VerticalPanel(); panelFields.Add(strFieldText); ImageObject myEntityImage = new ImageObject(CurrentUser.VirtualImgPath() + "Icons/company.png"); this.AddTopContent(new HorizontalPanel(myEntityImage, panelFields));
  • Slide 27 "; strCrumbTrail += " System ->"; strCrumbT"> "; strCrumbTrail += " System ->"; strCrumbTrail += " My Admin ->"; HTMLString strFieldText = new HTMLString(strCrumbTrail); VerticalPanel panelFields = new VerticalPanel(); panelFields.Add(strFieldText); ImageObject myEntityImage = new ImageObject(CurrentUser.VirtualImgPath() + "Icons/admin.png"); this.AddTopContent(new HorizontalPanel(myEntityImage, panelFields));"> "; strCrumbTrail += " System ->"; strCrumbT" title="Admin Screen TopContent //change the breadcrumb trail as needed; string strCrumbTrail = " Administration ->"; strCrumbTrail += " System ->"; strCrumbT">
  • Admin Screen TopContent //change the breadcrumb trail as needed; string strCrumbTrail = " Administration ->"; strCrumbTrail += " System ->"; strCrumbTrail += " My Admin ->"; HTMLString strFieldText = new HTMLString(strCrumbTrail); VerticalPanel panelFields = new VerticalPanel(); panelFields.Add(strFieldText); ImageObject myEntityImage = new ImageObject(CurrentUser.VirtualImgPath() + "Icons/admin.png"); this.AddTopContent(new HorizontalPanel(myEntityImage, panelFields));
  • Slide 28
  • Button Types Main Default Buttons AddEditButton AddHelpButton AddDeleteButton AddContinueButton AddSaveButton AddCancelButton Custom Buttons AddConfirmButton("CaptionCode","Image.gif","Question"); AddConfirmButton("CaptionCode","Image.gif","Question","fieldname","fieldvalue"); AddSubmitButton("CaptionCode","Image.gif","javascript") AddSubmitButton("CaptionCode","Image.gif","fieldname","fieldvalue"); AddUrlButton("CaptionCode","Image.gif","URL"); string test = "/Main Menu/wwhelp/wwhimpl/js/html/wwhelp.htm?href=AddingInformation.html"; AddHelpButton(test);
  • Slide 29
  • Special Help Method Add the help b

Recommended

View more >