View
218
Download
3
Embed Size (px)
Citation preview
For Microsoft Dynamics CRM Partners
Taking Advantage of Web Resources
Presented By:
Sebastian Waksmundzki
AlfaPeople
Prague April 3 - 6, 2011
For Microsoft Dynamics CRM Partners
WhoAmiRequest
• Senior Dynamics Architect @ AlfaPeople– 10 Years Experience– Still love technology – CRM, SharePoint, ERP(s)
• Social– Blog www.mindthecloud.net– Twitter @qmiswax
For Microsoft Dynamics CRM Partners
Agenda• Web Resources
– Capabilities– Limitations
• Real Life– Virtual Paths– Demo – Tools
• Web Resources and Solutions• Q&A
For Microsoft Dynamics CRM Partners
For Microsoft Dynamics CRM Partners
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/
For Microsoft Dynamics CRM Partners
Web Resource Types
File File extensions Type Web Page (HTML) .htm, .html 1Style Sheet (CSS) .css 2Script (JScript) .js 3Data (XML) .xml 4Image (PNG) .png 5Image (JPG) .jpg 6Image (GIF) .gif 7Silverlight (XAP) .xap 8StyleSheet (XSL) .xsl, .xslt 9Image (ICO) .ico 10
For Microsoft Dynamics CRM Partners
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
For Microsoft Dynamics CRM Partners
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
For Microsoft Dynamics CRM Partners
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
For Microsoft Dynamics CRM Partners
Common Functionsfunction changeElementBackground(elementName, colour) { $(elementName).css("backgroundColor", colour);}
function highlightControlText(controlName, colour) { $('#' + controlName).css("color", colour);}
function highlightBackground(controlName, colour) { $('#' + controlName).css("backgroundColor", colour);}
For Microsoft Dynamics CRM Partners
Demo of JS library
For Microsoft Dynamics CRM Partners
Execution Context
• Passed to Jscript function as first parameter
• Tells you about object generated the event
For Microsoft Dynamics CRM Partners
Execution contextfunction DoSomething(context){ var oField = context.getEventSource().getValue(); if (typeof(oField) != "undefined" && oField != null) { } context.getEventSource().setValue(“whatever”);}
For Microsoft Dynamics CRM Partners
Look and feel with data
• Look and feel: HTML pages (css)/Silverlight
• Data: REST – Html page + jquery – Silverlight
For Microsoft Dynamics CRM Partners
REST
Microsoft Dynamics CRM Implementation of REST (Odata) OData Entity Data Model (EDM)
[Your Organization Root URL]/xrmservices/2011/organizationdata.svc
[Your Organization Root URL]/xrmservices/2011/organizationdata.svc/$metadata
For Microsoft Dynamics CRM Partners
REST ()
OData Query Designerhttp://crm2011odatatool.codeplex.comCrmRestKit (Dynamics CRM 2011)http://crmrestkit.codeplex.com/
For Microsoft Dynamics CRM Partners
CrmRestKit // CREATEvar contact = CrmRestKit.Create('Contact', { FirstName: ‘Seb', LastName: ‘W' });
// RETRIEVECrmRestKit.Retrieve('Contact', contact.ContactId, ['ContactId', 'ParentCustomerId'], function (contact) {
var contactId = contact.ContactId;// ...
});
For Microsoft Dynamics CRM Partners
Passing Parameters htmlParameter Name Description
typename Entity Name The name of the entity
type Entity Type CodeAn integer that uniquely identifies the entity in a specific organization.
id Object GUID The GUID that represents a record.
orgname Organization Name The unique name of the organization.
userlcid User Language CodeThe language code identifier being used by the current user.
orglcid Organization Language Code
The language code identifier that represents the base language for the organization.
data Optional Data Parameter An optional value that may be passed.
For Microsoft Dynamics CRM Partners
Virtual/Relative paths
• WebResources can be developed and tested outside of Microsoft Dynamics CRM 2011 and then imported
• Virtual folder structure
For Microsoft Dynamics CRM Partners
Demo (Geo Locate)
For Microsoft Dynamics CRM Partners
Object Model
For Microsoft Dynamics CRM Partners
Images
• JPG, PNG, GIF• Ribbon $webresource Directive • Custom entity icons • Background for html• Custom form features
For Microsoft Dynamics CRM Partners
Data (XML)
• Save and access data• Cache data that you want to use in
your solution• This is not another DB
For Microsoft Dynamics CRM Partners
Tools
• Web Resource Utility• Minify (PowerShell)• CRM 2011 Dev Toolkit
– see Marco Amoedo and his session
For Microsoft Dynamics CRM Partners
Solution Management
For Microsoft Dynamics CRM Partners
Demo (Tools)
For Microsoft Dynamics CRM Partners
Sebastian WaksmundzkiAlfaPeople
Thank You for Attending extreme 2011!
Please remember to fill out your session evaluation form.