Skip to main content

Posts

BPFs on steroids – using Business Process Flows to implement a fully guided lifecycle of a record

We are all familiar with Business Process Flows (BPF) in Dynamics 365 – they’ve been around for a while. The set of chevrons at the top of the single record form typically represents major phases in the record’s lifecycle. Phases of record lifecycle or BPF The problem : When starting a new project, we usually end up designing and building a set of BPFs for the most important records in our system. However, one of the first questions we often hear from users after the new project goes live is “Is there a way to hide BPF area of the form?”. The real-life usage of BPFs sometimes falls short of the promise to make users' lives easier by guiding them through a business process. The reason many users often fail to see much utility in BPFs is that a typical BPF is weakly connected to actual processes users go through when working with data and often fails to serve as an enforcer of institutional rules. A purely visual guide with a random set of fields under each stage’s chevron quickly …
Recent posts

How to modify header of CRM entity form

CRM single-record form always displays the same word 'Information' in the header area below entity name. This area can be reused to display something more meaningful about the record using simple script below:

var headerElement = document.getElementById("leftNavBreadcrumbText");

if (headerElement != null) {
//Can change style in any way
// headerElement.style.color = [Select color];
headerElement.innerHTML = 'More info about this record...';
}

MSCRM4 Web Service Toolkit for JavaScript

Daniel Cai (http://danielcai.blogspot.com) published a great little bit of JavaScript that cleverly packages CRM's APIs for a very easy consumption through JavaScript. After including his code, distributed through Microsoft Public License, you can write update/create or other CRM Web Service calls using a very simple syntax. For example, code below updates an entity:

var memberId =;
var updateMember = new CrmServiceToolkit.BusinessEntity("new_member");
var updateDict = {
"nr_dob": dateOfBirth,
"nr_workphone": workPhone,
"nr_cellphone":cellPhone,
"nr_email": email
};

updateMember.attributes["new_memberid"] = memberId;

for (var key in updateDict) {
if (updateDict[key] != null) updateMember.attributes[key] = updateDict[key];
}

var updateResponse = CrmServiceToolkit.Update(updateMember);
if (!updateResponse == "") { alert("Member update failed!"); }

New features of Microsoft Dynamics CRM 5.0 - extended list

Main new features

• Single page for all views, including single record
• subgrids
• collapsible sections
• customizable lookups
• office ribbon (fully customizable)
• aggregate charts for any grid
• groupby in FetchXML
• MOSS integration and provisioning
• teams can have roles, own records and queues, be default
• supports partial code trust on server
• Solution management
• Auditing
• global picklists

Forms

• global search box
• header, footer for single record view
• multiple forms per entity (based on user role and record type)
• custom tabs
• new form editor supports drag/drop, inline properties
• new controls (subgrid, choice)
• any control is overridable
• ribbon controls can be created for any form/grid/entity-based, context sensitive
• ISV isolation

Custom code

• Plugins in online environment
• CRM and metadata services consolidated
• support for CRM transactions and tracing from code
• CAS (execution permissions)
• separate processes per tenant
• plugin profiler and monitoring
• plugin publishing per tenan…

Main new features in CRM 5.0

• Single page for all views, including single record
• subgrids
• collapsible sections
• customizable lookups
• office ribbon (fully customizable)
• aggregate charts for any grid
• groupby in FetchXML
• MOSS integration and provisioning
• teams can have roles, own records and queues, be default
• supports partial code trust on server
• Solution management
• Auditing
• global picklists

Creating inline toolbar

This code creates inline buttons on the form which greatly enhance usually bland CRM UI.
Code is taken from Adi Katz' blog http://mscrm4ever.blogspot.com/


////Example
//function OnCrmPageLoad()
//{
// window.GeneralToolbar = new InlineToolbar("gi_toolbar");
// GeneralToolbar.AddButton("btnReset","Reset","15%",Reset_Click);
// GeneralToolbar.AddButton("btnLookup","Lookup","10%",Lookup_Click);
// //GeneralToolbar.RemoveButton("btnLookup");
// GeneralToolbar.AddButton("btnAddNote","Create Note","16px",AddNote_Click,"/_imgs/ico_16_5_d.gif");
//}
//
//function Reset_Click()
//{
// alert('Reseting Fields...');
//}
//
//function Lookup_Click()
//{
// alert('lookup records...');
//}
//
//function AddNote_Click()
//{
// alert('Add new note');

//}

function InlineToolbar(containerId)
{
var toolbar = this;
var container = document.all[containerId];

if (!container)
{
return alert(&q…

Creating note with a file attachment

There is often a need to attach a file to an entity (contact, task, etc.). Easiest way to do it is by creating a note belonging to the entity and attaching a file to the note. Code below shows how to create a note, encode a file, attach file to the note and attach note to a parent entity.



public string GetMimeType(byte[] fileBytes)
{
try
{
System.Security.Cryptography.Pkcs.ContentInfo info = new System.Security.Cryptography.Pkcs.ContentInfo(fileBytes);
return info.ContentType.Value;
}
catch
{
return "application/octet-stream";
}
} // end GetMimeType

private void AddAttachment(CrmService.CrmService crmService, Guid parentAnntotationId, string attachmentBase64Data, string mimeType, string attachmentFileName)
{
CrmService.UploadFromBase64DataAnnotationRequest upload = new CrmService.UploadFromBase64DataAnnotationRequest();

upload.AnnotationId = parentAnntotationId;
upload.FileName = attachmentFileName;
upload.MimeType = mimeType;
upload.Base64Data = attachmentBase64Data;

crmService.Execute(upload)…