{Utility}Dialogs Property box in Dynamics CRM 2013 Form

I really used to like the CRM 2011 Dialogs Properties window. If you have forgotten, here is a screen which might make you remember the properties dialog on the form:

image

I just wanted to have a working one in CRM 2013 as well. A little drilling made me understand that is it pretty much available in CRM 2013 as well (in system pages of CRM), so here is what I did:

Step 1:

Embed one html web resource called properties in the Admin forms I Need:

You can directly download doc file from here convert it to html and then upload as html web resource to your forms.

Source code below:

<html xmlns=”http://www.w3.org/1999/xhtml”&gt;

<head>

</head>

<body id=”bodyId” onload=”onload()”>



<script src=”ClientGlobalContext.js.aspx” type=”text/javascript”></script>

<script type=”text/javascript”>

function onload() {

var url = window.parent.Xrm.Page.context.getClientUrl() + “/_forms/properties/properties.aspx?id=” + window.parent.Xrm.Page.data.entity.getId().toString().substr(1, (window.parent.Xrm.Page.data.entity.getId().toString().length – 2)) + “&objTypeCode=” + window.parent.Xrm.Page.context.getQueryStringParameters().etc;

document.getElementById(“tt”).src = url;

}

</script>

<title></title>

//Iframe with id ‘tt’ needs to be embedded here

</body>

</html>

Step 2:

Add a Tab named properties to the form and put web resource inside it.

The screen will look pretty much like the one below:

clip_image002

Note: This webresource is reusable for all CRM entities.

Ask your Query : Click here

Hope it helps!

{Work Around}Issue with Fields locked on form but not in Business Process Area : Dynamics CRM 2013

One of the issues I had noticed earlier with Business process area in Dynamics CRM 2013 during CRM 2013 Rollup 1 was that business process area didn’t take the fields in CRM 2013 Form (specially on load) into consideration while showing field as enabled/disabled, visible/not visible etc. I find the same issue still existent with CRM 2013 SP1 Rollup 1. What I am trying to say is say we need some fields as disabled on the form, CRM 2013 Business process area does not take it into consideration and Business process area is still editable. Look at the scenario in below screen. Here we have the same field in two places, one in the business process area and one on the form, highlighted in red rectangle below. You can notice that the field is disabled on form, but still enabled in Business Process area which just breaks the disabled field in the form:

clip_image002

For Scenarios like this, following a good workaround:

We need to create a business rule without any condition, Refer screen below:

clip_image004

Once this is applied, the field will be locked in both places (Marked in green rectangles):

clip_image006

This is extensible in sense that as we need more disabled fields, we just need to keep it adding to the business rule.

Ask your Query : Click here

Hope it helps!

Business Rules without any condition –Dynamics CRM 2013

I wonder if anybody ever tried this before. Often we need to trigger a business rule on form irrespective of the form values, something which always needs to be done. In CRM 2013, one of my colleagues pointed out to me that there is no actual need of putting any If condition. So I tried it with account name field, showing error message at all times on Account name field in Account entity. First I tried if Business rule will be allowed to be saved and activated. To my surprise, it is allowed in CRM 2013, just have a look below:

clip_image002

The next thing to check was what is going on in the Account form now. It had the error message as soon as I opened the form, which was permanently there(Look at highlighted rectangle in red):

clip_image004

So, whenever you want to trigger a business rule without any condition, it is possible to do so.

Ask your Query : Click here

Hope it helps!

{New Feature}Embedding Views in Forms without command and navigation bar (CRM 2013 SP1 and above)

When I was doing a CRM upgrade for one of my earlier projects (CRM 2013 Rollup 1), there was a requirement of showing unrelated records (no relationship entities) on VIEW on a form. We tried lot of approaches and ended up making custom web resources. IN SP1 for 2013, Microsoft product team has added a little wonder as a result of which now it is possible to achieve it (I also need to mention about my bond friend who actually asked for it and I came across this, Thanks bond Friend,anonymity is guaranteed to 007!)

So here is the screen for my form:

clip_image002

What needs to be done here is below:

Step 1: Make an html web resource, see code below:

<html><head>

<title>Live Feed</title>

<style type=””text/css””>

html, body {

border: none;

margin: 0;

overflow-y: hidden;

overflow-x: hidden;

}

</style>

<meta charset=””utf-8″”>

<meta></head>

<body style=”word-wrap: break-word;”>

//Iframe here

https://servername/main.aspx?etc=2&extraqs=%3fpagemode%3diframe%26sitemappath%3dSFA%257cCustomers%257cnav_conts&pagetype=entitylist&viewid=%7b00000000-0000-0000-00AA-000010001004%7d&viewtype=1039&cmdbar=false&navbar=off

</body></html>

Note: Notice URL of the view here:

“&cmdbar=false&navbar=off” in the end

Reference from MSDN:

navbar

This capability was introduced with the CRM Online Spring ’14 and CRM 2013 Service Pack 1 releases.

Controls whether the navigation bar is displayed and whether application navigation is available

using the areas and subareas defined in the sitemap.

· on
The navigation bar is displayed. This is the default behavior if the navbar parameter is

not used.

· off
The navigation bar is not displayed. People can navigate using other user interface

elements or the back and forward buttons.

· entity
On an entity form, only the navigation options for related entities are available.

After navigating to a related entity, a back button is displayed in the navigation

bar to allow returning to the original record.

cmdbar

This capability was introduced with the CRM Online Spring ’14 and CRM 2013 Service Pack 1

releases.

Controls whether the command bar is displayed.

· true
The command bar is displayed. This is the default.

· false
The command bar is hidden.

Step 2: Add this web resource to your form and you are done!

Ask your Query : Click here

Hope it helps!

{Error resolution} ISV code aborted the operation for Dynamics CRM

Out of the blue, we started getting following error on trace of one of the web service we have which consumes organisation service in turn(We were using Auto number solution available on codeplex):

The Web Service plug-in failed in OrganizationId: 07807e38-0593-e311-b686-0050568572e3; SdkMessageProcessingStepId: 14eb4ee7-c99d-e111-b463-1cc1de6e2b2d; EntityName: cal_pform; Stage: 20; MessageName: Create; AssemblyName: Xbitz.Crm.AdvancedCRMAutoNumber.GenerateAutoNumber, Xbitz.Crm.AdvancedCRMAutoNumber, Version=1.0.0.0, Culture=neutral, PublicKeyToken=b0dbcd530d1b2c81; ClassName: Xbitz.Crm.AdvancedCRMAutoNumber.GenerateAutoNumber; Exception: Unhandled Exception: System.ArgumentNullException: Value cannot be null.

Parameter name: pattern

at System.Text.RegularExpressions.Regex..ctor(String pattern, RegexOptions options, TimeSpan matchTimeout, Boolean useCache)

at System.Text.RegularExpressions.Regex.Matches(String input, String pattern, RegexOptions options, TimeSpan matchTimeout)

at ᡕ龁俄凢▥ᾑ﫡ӿ.굜ﱘ厭鴌ꌃ縛ᴉ㹃(AutoNumberSetting ᶛ핁븪쇂Ê건攇䐔, Entity ꣤᩸ၕ䧝隄旮୏, Int64 賑彏蹒準峳刉)

at Xbitz.Crm.AdvancedCRMAutoNumber.GenerateAutoNumber.Execute(IServiceProvider serviceProvider)

at Microsoft.Crm.Extensibility.V5PluginProxyStep.ExecuteInternal(PipelineExecutionContext context)

at Microsoft.Crm.Extensibility.VersionedPluginProxyStepBase.Execute(PipelineExecutionContext context)

.

On going through inner exception we found it was:

80040265

IsvAborted

ISV code aborted the operation.

IDS_ISV_ABORTED

Resolution: We just downloaded the managed solution again and re-installed it(Remember to mark Overwrite customizations option):

clip_image002

Ask your Query : Click here

Hope it helps!

{Scripting titbits} Coming in Dynamics CRM 2015: Business Process Flows

I wanted to do Scripting tit bits for CRM 2015 Business Process flow in one blog but there is so much functionality being added. I did it in two parts.  

Hence I did it in two parts:

PART 1: Click here

PART 2{Event handlers for Business Process Flow}: Click here

Source: CRM 2015 SDK Preview

Ask your Query : Click here

Hope it helps!

{Scripting titbits} Coming in Dynamics CRM 2015: Business Process Flows{Part 2}

In Dynamics CRM 2015, we have a way to show/hide and expand/collapse business process area:

Under Xrm.Page.ui.process methods

setDisplayState

Use this method to expand or collapse the business process control.

Javascript:

Xrm.Page.data.process.setDisplayState(strExpanded);

Parameter

Type:String

Remarks:expanded” to expand the control, “collapsed” to collapse it.

setVisible

Use this method to show or hide the business process control.

Javascript:

Xrm.Page.data.process.setVisible(boolVisible);

Parameter

Type:Boolean

Remarks:true to show the control; otherwise, false.

Sometimes there is need to have scripts to do some stuff on the form when stage is changed. In Dynamics CRM 2015, following has been included:

There are two events for user interaction with the business process flow control.

OnStageChange

Occurs when a stage changes. More information: OnStageChange event.

OnStageSelected

Occurs when a stage is selected. More information: OnStageSelected event.

Note: There is no UI to register scripts for these events.

It needs to be registered in the form OnLoad event to register your functions for

these events.

· Xrm.Page.data.process.addOnStageChange

Javascript: Xrm.Page.data.process.addOnStageChange(handler);

Below methods follow the same structure:

· Xrm.Page.data.process.addOnStageSelected

· Xrm.Page.data.process.removeOnStageChange

· Xrm.Page.data.process.removeOnStageSelected

Source: CRM 2015 SDK Preview

Ask your Query : Click here

Hope it helps!

Keyboard shortcuts for CRM 2013

My colleague recently passed me this useful link for CRM 2013 Keyboard shortcuts. I thought it will be a useful thing to know. so posting it here:

To

Press

Move to the next option, option group, or field

Tab

Move to the previous option, option group, or field

Shift+Tab

Complete the command for the active option or button

Enter

Move between options in an open list, or between options in a group of options

Arrow keys

Cancel a command, or close a selected list or dialog box

Esc

Save

Ctrl+S or Shift+F12

Save and Close

Alt+S

Cancel edits and close (Close)

Esc

Open search

Spacebar or Enter

Delete text from a field

Backspace

Delete the record (when forms are in Edit mode)

Ctrl+D

Save and then open a new form (Save and New) (when forms are in Edit mode)

Ctrl+Shift+S

Move to another field or command

Tab

Open the lookup menu with the most recently used items in alphabetical order

Alt+Down Arrow

Open the list menu (when forms are in Edit mode)

Ctrl+Shift+2

Navigate to the next item on the list (when forms are in Edit mode)

Ctrl+>

Navigate to the previous item on the list (when forms are in Edit mode)

Ctrl+<

Open lookup drop-down list

Enter

Close lookup drop-down list

Esc

Auto-resolve lookup value

Ctrl+K

Open a record found in lookup with forms in Edit mode

Enter

Open a record found in lookup with forms in Read-optimized mode

Ctrl+Enter

Add a step in the business process editor

Alt+Shift+N

Tab to Command Bar when in the updated user experience

Ctrl + [

Tab to process control when in the updated user experience

Ctrl + ]

Tab to the Navigation Pane

Ctrl + Shift + 3

Accessibility keyboard shortcuts

If you’re running Microsoft Windows, you can set system accessibility options to match the way you work. For example, you can use Windows Sticky Keys if you have difficulty holding down two or more keys at a time, such as Ctrl+P. Sticky Keys enable you to press the Ctrl key and have it remain active until you press the P.

To

Press

Switch Sticky Keys on and off

Shift five times

Switch Filter Keys on and off

Right Shift for eight seconds

Switch Toggle Keys on and off

Num Lock for five seconds

Switch High Contrast on and off

Left Alt+Left Shift+Print Screen

Switch Mouse Keys on and off

Left Alt+Left Shift+Num Lock

Tab into an Active X control

Alt+Shift+F10

Mac keyboard shortcuts

These keyboard shortcuts apply when using a Mac.

Action

Windows Keys

Mac Keys

Notes

Tab

Tab

Shift+Tab

Tab

Shoft+Tab

Enable Tabbing in System Preferences and Safari Preferences (refer to Apple and Safari documentation).

Access keys

Alt + Access key

Ctrl + Alt + Access key

For example, the Next button uses N as its access key.

Microsoft Dynamics CRM Shortcut keys

Ctrl + key

Ctrl + key

For example, move to the first tab in the ribbon control with Ctrl + {. Save using Ctrl + S.

Activate Control

Space / Enter

Space / Enter

 

Close topmost window

Window + W

Command + W

Refer to Apple support documentation.

Applies to : CRM 2013

Source: Click here

Ask your Query : Click here

Hope it helps!