270 likes | 486 Views
Taking Advantage of Web Resources. Presented By: Sebastian Waksmundzki AlfaPeople. Prague April 3 - 6, 2011. WhoAmiRequest. Senior Dynamics Architect @ AlfaPeople 10 Years Experience Still love technology CRM, SharePoint, ERP(s) Social Blog www.mindthecloud.net
E N D
Taking Advantage of Web Resources Presented By: Sebastian Waksmundzki AlfaPeople Prague April 3 - 6, 2011
WhoAmiRequest Senior Dynamics Architect @ AlfaPeople 10 Years Experience Still love technology CRM, SharePoint, ERP(s) Social Blog www.mindthecloud.net Twitter @qmiswax
Agenda • Web Resources • Capabilities • Limitations • Real Life • Virtual Paths • Demo • Tools • Web Resources and Solutions • Q&A
What are Web Resources Long long time ago (v4) there was only chaos… Now: Virtual files stored in the DB unique URL address On-premise and Online https://MyOrganization.crm.dynamics.com/WebResources/ http://myServer/MyOrganization/WebResources/
Capabilities Used to extend the Microsoft Dynamics CRM Web application Reusability of code (JS Libraries) Familiar technologies for developers Pack and go deployment model Accessible via SDK Available offline
Limitations Only client side Only for licensed Microsoft Dynamics CRM users (CRM security context) Organization.MaxUploadFileSize property One missing type (.aspx) to execute code on the server
JavaScript Library JScript libraries are reusable Up to 50 scripts per entity form Up to 50 functions as event handlers Execution Context to determine Depth, Event Source, shared variables
Common Functions function changeElementBackground(elementName, colour) { $(elementName).css("backgroundColor", colour); } function highlightControlText(controlName, colour) { $('#' + controlName).css("color", colour); } function highlightBackground(controlName, colour) { $('#' + controlName).css("backgroundColor", colour); }
Execution Context Passed to Jscript function as first parameter Tells you about object generated the event
Execution context function DoSomething(context) { varoField = context.getEventSource().getValue(); if (typeof(oField) != "undefined" && oField != null) { } context.getEventSource().setValue(“whatever”); }
Look and feel with data Look and feel: HTML pages (css)/Silverlight Data: REST Html page + jquery Silverlight
REST Microsoft Dynamics CRM Implementation of REST (Odata) OData Entity Data Model (EDM)
REST () OData Query Designer http://crm2011odatatool.codeplex.com CrmRestKit (Dynamics CRM 2011) http://crmrestkit.codeplex.com/
CrmRestKit // CREATE var contact = CrmRestKit.Create('Contact', { FirstName: ‘Seb', LastName: ‘W' }); // RETRIEVE CrmRestKit.Retrieve('Contact', contact.ContactId, ['ContactId', 'ParentCustomerId'], function (contact) { varcontactId = contact.ContactId; // ... });
Virtual/Relative paths WebResources can be developed and tested outside of Microsoft Dynamics CRM 2011 and then imported Virtual folder structure
Images JPG, PNG, GIF Ribbon $webresourceDirective Custom entity icons Background for html Custom form features
Data (XML) Save and access data Cache data that you want to use in your solution This is not another DB
Tools Web Resource Utility Minify (PowerShell) CRM 2011 DevToolkit see Marco Amoedo and his session
Sebastian Waksmundzki AlfaPeopleswa@alfapeople.com Thank You for Attending extreme2011! Please remember to fill out your session evaluation form.