Many times while working in Dynamics 365 CRM we found small clues tips which sometimes becomes life saver for us. Today in this blog I will share one of such small tip.
If we enter special characters like # $ % & ( ‘ in text input the GetControl & Getattribute will give different result.
Example:
Xrm.Page.getControl(ikl_folderpath).getValue() = /folderpath
Xrm.Page.getAttribute(ikl_folderpath).getValue() = /folderpath#
Both the statement above will give different results as shown in the below screenshot.
GetControl() method replaces the special characters # $ % & ( ‘ to blank if it is placed at the end whereas GetAttribute() method doesn’t remove any special characters from the end and displays it as it is.
Hope this helps!