web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Dynamics 365 Community / Blogs / Hosk's Dynamic CRM Blog / CRM 2015 – How to set focus...

CRM 2015 – How to set focus in Javascript

Hosk Profile Picture Hosk

I wanted to set focus in Javascript after a user had changed a field to yes, this triggered an onchange event.  The onChange event set a new tab to be visible.

The new tab was below and the users didn’t always know it was there, so I wanted to nudge them in the right direction by setting focus on the tab.

Microsoft has added a great framework for manipulating the controls.  The Javascript for setting focus works on the Control level

Xrm.Page.getControl(arg).setFocus()

Xrm.Page.ui.tabs.get(“tab_schemaName”).setFocus();
Xrm.Page.getControl(“ntt_reviewteamid”).setFocus();

This blog post has a great page, it highlights the functionality available in the CRM SDK, displaying the logical structure of the JavaScript wrapper created for development

Microsoft Dynamics CRM 2013: Client API Enhancement

 

Different Versions

It’s important to check the CRM SDK XRM documentation because each release of CRM adds and removes functions.

Xrm.Page.ui control (client-side reference)

The CRM SDK documentation shows the functionality available for each release by selecting the CRM version in the drop down at the top of the page.

Javascript versions

When you select a different version it will change the methods available.  This enables you to see what functionality is available for each version and what new functionality has been added.


Filed under: CRM 2011, CRM 2013, CRM 2015, Javascript

This was originally posted here.

Comments

*This post is locked for comments