bpf field onchange

Let’s start by saying that this is not supported in crm.

field on change is usually defined in the form designer. Since bpf designer doesn’t offer ways to change property of its fields, the only way is to add change through the dom.

In the case of optionset control, it’s made up of label and select control (show label in display node, show select control and hide label in edit mode).

To start, we get the control, which is part of xrm:

var ctrl = xrm.page.getControl(“name”)

Then, we go get the view:
var v=  ctrl.get_editView()

In the case of optionset control, the edit element is a select control:

var select = v.get_editElement()

change handler is inserted via jquery:

select.change(function() {alert(“select changed”);});

Advertisements

About s1301950

Dynamics CRM Developer with more than 5 years of experience in both 4.0 and 2011. Specialized in customization and development in plugins, custom workflows and xrm javascript. Also have more than 10 years of asp.net development. Currently engaged in projects using asp.net/C# 4.0 with LINQ and Identity framework (WIF)
This entry was posted in bpf, crm 2015, event, unsupported. Bookmark the permalink.

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 )

Twitter picture

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

Facebook photo

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

Google+ photo

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

Connecting to %s