{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!

Advertisement

One thought on “{Scripting titbits} Coming in Dynamics CRM 2015: Business Process Flows{Part 2}

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s