MICROSOFT DYNAMICS CRM 2016
NEW CLIENT SIDE FEATURES
The New Client Scripting Method
Introduced in Microsoft Dynamics
CRM 2016 with the release that we
can use make to user experience and
interactive while data entered into the
crm forms.
METHOD – GETVALUE
• This method was previously available only for attribute
collection and using it we could get field value after the field
was updated and while the cursor was unfocused from that
field. Now, we can capture value of field as early as when users
start entering value in field. We can use this method as shown
below:
Xrm.Page.getControl(field name).getValue();
Where we want the user to enter value as per our specific pattern or regular
expression, we can use code mentioned below:
function OnfieldKeyPress() {
var fieldValue = Xrm.Page.getControl(“field name
here”).getValue().toString().replace(/[^0-9]/g, “”);
Xrm.Page.getAttribute(“field name here”).setValue(fieldValue);
}
This method will work only if we call this on a Keypress event. So let’s
first understand how to call a function on Keypress event for a text field.
Note:
JScript Code : OnLoad Event
EVENT -KEYPRESS
The following three Keypress methods are added for 2016 version:
1) addOnKeyPress()
This is used to attach a function with a Keypress event:
Xrm.Page.getControl (fieldname).addOnKeyPress(function name);
If we add this statement in function which is called at the loading of the form, then
OnFieldKeyPress function will be attached with Keypress event of field.
2) removeOnKeyPress()
This is used to remove/detach a function that is attached with a Keypress event:
Xrm.Page.getControl(fieldname).removeOnKeyPress(function
name);
3) fireOnKeyPress()
This is used to call Keypress event handler for text or a number field.
Xrm.Page.getControl(field name).fireOnKeyPress();
So addOnKeyPress and removeOnKeyPress basically attach or delete already
attached function with Keypress event while fireOnKeyPress enables Keypress
event for text or number fields.
Example
New key Press Method on telephone number field
First we will setup a function on the new addOnKeyPress event for the main
telephone field.
Xrm.Page.getControl('telephone1').addOnKeyPress(function() { });
Then we will retrieve the value from the main telephone field to get the keys that
the user inputted.
var userInput = Xrm.Page.getControl('telephone1').getValue();
Then we will build a regex to replace any of the inputted keys that are not “(“, “)”,
“-“, or a number.
userInput = userInput.replace(/[^d-()]+/g, '');
Lastly, we will replace the main telephone value with the new clean version of the
user’s input
Xrm.Page.getAttribute('telephone1').setValue(userInput);
It’s just that easy! Now if a user presses an invalid character in the main
telephone field, it will automatically delete the character so the field will not be
saved with invalid data.
JavaScript Code
SetKeyPressMethodOnTelephoneNumber = function () {
Xrm.Page.getControl(‘telephone1’).addOnKeyPress(function () {
var userInput = Xrm.Page.getControl(‘telephone1’).getValue();
userInput = userInput.replace(/[^d-()]+/g, ”);
Xrm.Page.getAttribute(‘telephone1’).setValue(userInput);
});
}
Call these Methods on Form load Event
Note:
Thank You
K.Naveen Kumar
Microsoft Dynamics CRM Technical Consultant

More Related Content

DOCX
Temp conversion
PPT
Lesson 3.4
PDF
PART 6: FROM GEO INTO YOUR REPORT
PDF
PART 3: THE SCRIPTING COMPOSER AND PYTHON
PDF
PART 4: GEOGRAPHIC SCRIPTING
PDF
PART 5: RASTER DATA
PPTX
Mini lesson presentation
 
PPTX
2.6 transformations
Temp conversion
Lesson 3.4
PART 6: FROM GEO INTO YOUR REPORT
PART 3: THE SCRIPTING COMPOSER AND PYTHON
PART 4: GEOGRAPHIC SCRIPTING
PART 5: RASTER DATA
Mini lesson presentation
 
2.6 transformations

What's hot (7)

DOCX
Dti2143 lab sheet 9
PPT
Piecewise Functions
PPTX
Cse 121 presentation on matrix [autosaved]
PPTX
Graphing Inequalities Example
PPTX
Sketching derivatives
DOCX
PPTX
CHAPTER 3 - Lesson B
Dti2143 lab sheet 9
Piecewise Functions
Cse 121 presentation on matrix [autosaved]
Graphing Inequalities Example
Sketching derivatives
CHAPTER 3 - Lesson B

Viewers also liked (19)

PPTX
Make a positive change
PPT
Stockholm symposium pauwels 2008
PDF
20160914152030857
PPTX
要求獲得過程の観測と評価に関するツールの開発
PDF
Reflections on Team Building at Land 2013 Jul 31
PDF
TheZaeList Deck
PPTX
Business rulers in Microsoft Dynamics CRM 2013
DOCX
งานคอม
PDF
Canadian Cancer Society, Ontario Division - Impact Report 2009-10
PPTX
The Outer Planets
PPTX
Why Upgrade from Microsoft CRM 2011 to CRM 2015?
PDF
Salesforce Case Management with Canadian Cancer Society, Salesforce.org, and ...
PPTX
Adaptive Case Management Awards Ceremony 2016
PPTX
Plugin vs Workflow in Microsoft Dynamics CRM
PPTX
30% - 60% of CRM Projects Fail
PPTX
Getting started with Microsoft dynamics crm 2016
DOCX
Interview Questions For Microsoft Dynamics CRM
PPTX
Patanjali 2
Make a positive change
Stockholm symposium pauwels 2008
20160914152030857
要求獲得過程の観測と評価に関するツールの開発
Reflections on Team Building at Land 2013 Jul 31
TheZaeList Deck
Business rulers in Microsoft Dynamics CRM 2013
งานคอม
Canadian Cancer Society, Ontario Division - Impact Report 2009-10
The Outer Planets
Why Upgrade from Microsoft CRM 2011 to CRM 2015?
Salesforce Case Management with Canadian Cancer Society, Salesforce.org, and ...
Adaptive Case Management Awards Ceremony 2016
Plugin vs Workflow in Microsoft Dynamics CRM
30% - 60% of CRM Projects Fail
Getting started with Microsoft dynamics crm 2016
Interview Questions For Microsoft Dynamics CRM
Patanjali 2

Similar to New client side features - Microsoft Dynamics CRM 2016 (20)

PPTX
Flex 4 components from the firehose
PPTX
Flex 4 Components
PPTX
Robotlegs Extensions
PDF
Need to revise working code below,A good design means the applicat.pdf
PDF
Make sure to make a copy of the Google Doc for this lab into.pdf
DOC
Practicalfileofvb workshop
PPTX
Sap solution manager change request management
PDF
C# Advanced L02-Operator Overloading+Indexers+UD Conversion
PPT
Flex Maniacs 2007
PPTX
Progamming Primer Polymorphism (Method Overloading) VB
DOCX
srcCommissionCalculation.javasrcCommissionCalculation.javaimpo.docx
DOC
Open microsoft visual studio/tutorialoutlet
PDF
in C++ Design a class named Employee The class should keep .pdf
PDF
C programming session5
PDF
Google website call conversion (WCC) tracking
PPT
Java script
PDF
Windows phone 7 series
PPTX
Vb6.0 intro
DOCX
commission1Application.javacommission1Application.javaimport.docx
PPT
Citrix Mfcom Programming For Administrators
Flex 4 components from the firehose
Flex 4 Components
Robotlegs Extensions
Need to revise working code below,A good design means the applicat.pdf
Make sure to make a copy of the Google Doc for this lab into.pdf
Practicalfileofvb workshop
Sap solution manager change request management
C# Advanced L02-Operator Overloading+Indexers+UD Conversion
Flex Maniacs 2007
Progamming Primer Polymorphism (Method Overloading) VB
srcCommissionCalculation.javasrcCommissionCalculation.javaimpo.docx
Open microsoft visual studio/tutorialoutlet
in C++ Design a class named Employee The class should keep .pdf
C programming session5
Google website call conversion (WCC) tracking
Java script
Windows phone 7 series
Vb6.0 intro
commission1Application.javacommission1Application.javaimport.docx
Citrix Mfcom Programming For Administrators

More from Naveen Kumar (20)

PPTX
Microsoft SQL Server 2016
PPTX
Service Analysis - Microsoft Dynamics CRM 2016 Customer Service
PPTX
Email Router Configuration - Gmail and microsoft dynamics crm 2016 online int...
PPTX
Microsoft Dynamics CRM Multi - Tier Architecture
PPTX
Marketing Automation - Part 3
PPTX
Marketing Automation - Part 2
PPTX
Marketing Automation - Part 1
PPTX
Sales force automation - Part 4
PPTX
Sales force automation - Part 3
PPTX
Sales force automation - Part 2
PPTX
Business process flows presentation
PPTX
Part 3 - DNS Configuration (IFD)
PPTX
Part 2 - Setup ADFS (Active Directory Federation Service)
PPTX
Part 1 - Binding Certificates (IFD)
PPTX
Unified Service Desk - Part 3
PPTX
Unified service desk - Part 1
PPTX
New Feature in CRM 2016
PPTX
Customizing document templates
PPTX
Microsoft dynamics crm 2011 installation
PPTX
Sitemap in Microsoft Dynamics CRM 2011/2013
Microsoft SQL Server 2016
Service Analysis - Microsoft Dynamics CRM 2016 Customer Service
Email Router Configuration - Gmail and microsoft dynamics crm 2016 online int...
Microsoft Dynamics CRM Multi - Tier Architecture
Marketing Automation - Part 3
Marketing Automation - Part 2
Marketing Automation - Part 1
Sales force automation - Part 4
Sales force automation - Part 3
Sales force automation - Part 2
Business process flows presentation
Part 3 - DNS Configuration (IFD)
Part 2 - Setup ADFS (Active Directory Federation Service)
Part 1 - Binding Certificates (IFD)
Unified Service Desk - Part 3
Unified service desk - Part 1
New Feature in CRM 2016
Customizing document templates
Microsoft dynamics crm 2011 installation
Sitemap in Microsoft Dynamics CRM 2011/2013

Recently uploaded (20)

PPT
hsl powerpoint resource goyloveh feb 07.ppt
PDF
horaris de grups del curs 2025-2026 de l'institut
PDF
BSc-Zoology-02Sem-DrVijay-Comparative anatomy of vertebrates.pdf
PDF
V02-Session-4-Leadership-Through-Assessment-MLB.pdf
PDF
WHAT NURSES SAY_ COMMUNICATION BEHAVIORS ASSOCIATED WITH THE COMP.pdf
PDF
GSA-Past-Papers-2010-2024-2.pdf CSS examination
PDF
NGÂN HÀNG CÂU HỎI TÁCH CHỌN LỌC THEO CHUYÊN ĐỀ TỪ ĐỀ THI THỬ TN THPT 2025 TIẾ...
PDF
[Medicalstudyzone.com] 1. AIIMS NOV EMBER 2015 SOLVED PAPER.pdf
PDF
Global strategy and action plan on oral health 2023 - 2030.pdf
PPSX
namma_kalvi_12th_botany_chapter_9_ppt.ppsx
PDF
HSE and their team are going through the hazards of the issues with learning ...
PDF
Design and Evaluation of a Inonotus obliquus-AgNP-Maltodextrin Delivery Syste...
PDF
Jana-Ojana Finals 2025 - School Quiz by Pragya - UEMK Quiz Club
PDF
The 10 Most Inspiring Education Leaders to Follow in 2025.pdf
PDF
IS1343_2012...........................pdf
PPTX
Unit1_Kumod_deeplearning.pptx DEEP LEARNING
PDF
3-Elementary-Education-Prototype-Syllabi-Compendium.pdf
PDF
LATAM’s Top EdTech Innovators Transforming Learning in 2025.pdf
DOCX
HELMET DETECTION AND BIOMETRIC BASED VEHICLESECURITY USING MACHINE LEARNING.docx
PPTX
MALARIA - educational ppt for students..
hsl powerpoint resource goyloveh feb 07.ppt
horaris de grups del curs 2025-2026 de l'institut
BSc-Zoology-02Sem-DrVijay-Comparative anatomy of vertebrates.pdf
V02-Session-4-Leadership-Through-Assessment-MLB.pdf
WHAT NURSES SAY_ COMMUNICATION BEHAVIORS ASSOCIATED WITH THE COMP.pdf
GSA-Past-Papers-2010-2024-2.pdf CSS examination
NGÂN HÀNG CÂU HỎI TÁCH CHỌN LỌC THEO CHUYÊN ĐỀ TỪ ĐỀ THI THỬ TN THPT 2025 TIẾ...
[Medicalstudyzone.com] 1. AIIMS NOV EMBER 2015 SOLVED PAPER.pdf
Global strategy and action plan on oral health 2023 - 2030.pdf
namma_kalvi_12th_botany_chapter_9_ppt.ppsx
HSE and their team are going through the hazards of the issues with learning ...
Design and Evaluation of a Inonotus obliquus-AgNP-Maltodextrin Delivery Syste...
Jana-Ojana Finals 2025 - School Quiz by Pragya - UEMK Quiz Club
The 10 Most Inspiring Education Leaders to Follow in 2025.pdf
IS1343_2012...........................pdf
Unit1_Kumod_deeplearning.pptx DEEP LEARNING
3-Elementary-Education-Prototype-Syllabi-Compendium.pdf
LATAM’s Top EdTech Innovators Transforming Learning in 2025.pdf
HELMET DETECTION AND BIOMETRIC BASED VEHICLESECURITY USING MACHINE LEARNING.docx
MALARIA - educational ppt for students..

New client side features - Microsoft Dynamics CRM 2016

  • 1. MICROSOFT DYNAMICS CRM 2016 NEW CLIENT SIDE FEATURES
  • 2. The New Client Scripting Method Introduced in Microsoft Dynamics CRM 2016 with the release that we can use make to user experience and interactive while data entered into the crm forms.
  • 3. METHOD – GETVALUE • This method was previously available only for attribute collection and using it we could get field value after the field was updated and while the cursor was unfocused from that field. Now, we can capture value of field as early as when users start entering value in field. We can use this method as shown below: Xrm.Page.getControl(field name).getValue();
  • 4. Where we want the user to enter value as per our specific pattern or regular expression, we can use code mentioned below: function OnfieldKeyPress() { var fieldValue = Xrm.Page.getControl(“field name here”).getValue().toString().replace(/[^0-9]/g, “”); Xrm.Page.getAttribute(“field name here”).setValue(fieldValue); } This method will work only if we call this on a Keypress event. So let’s first understand how to call a function on Keypress event for a text field. Note: JScript Code : OnLoad Event
  • 5. EVENT -KEYPRESS The following three Keypress methods are added for 2016 version: 1) addOnKeyPress() This is used to attach a function with a Keypress event: Xrm.Page.getControl (fieldname).addOnKeyPress(function name); If we add this statement in function which is called at the loading of the form, then OnFieldKeyPress function will be attached with Keypress event of field.
  • 6. 2) removeOnKeyPress() This is used to remove/detach a function that is attached with a Keypress event: Xrm.Page.getControl(fieldname).removeOnKeyPress(function name); 3) fireOnKeyPress() This is used to call Keypress event handler for text or a number field. Xrm.Page.getControl(field name).fireOnKeyPress();
  • 7. So addOnKeyPress and removeOnKeyPress basically attach or delete already attached function with Keypress event while fireOnKeyPress enables Keypress event for text or number fields. Example New key Press Method on telephone number field First we will setup a function on the new addOnKeyPress event for the main telephone field. Xrm.Page.getControl('telephone1').addOnKeyPress(function() { });
  • 8. Then we will retrieve the value from the main telephone field to get the keys that the user inputted. var userInput = Xrm.Page.getControl('telephone1').getValue(); Then we will build a regex to replace any of the inputted keys that are not “(“, “)”, “-“, or a number. userInput = userInput.replace(/[^d-()]+/g, ''); Lastly, we will replace the main telephone value with the new clean version of the user’s input
  • 9. Xrm.Page.getAttribute('telephone1').setValue(userInput); It’s just that easy! Now if a user presses an invalid character in the main telephone field, it will automatically delete the character so the field will not be saved with invalid data. JavaScript Code SetKeyPressMethodOnTelephoneNumber = function () { Xrm.Page.getControl(‘telephone1’).addOnKeyPress(function () { var userInput = Xrm.Page.getControl(‘telephone1’).getValue(); userInput = userInput.replace(/[^d-()]+/g, ”); Xrm.Page.getAttribute(‘telephone1’).setValue(userInput); }); } Call these Methods on Form load Event Note:
  • 10. Thank You K.Naveen Kumar Microsoft Dynamics CRM Technical Consultant