The default ticker symbol field in Dynamics CRM 2011 is integrated with MSN Money to bring up information about the entered symbol. When this symbol is not found, the user is faced with an Information Not Available page. Unfortunately, only the website will validate the user input, not your CRM application. For us to validate the symbols, we need to implement an additional piece of functionality. We can thus prompt the user once they have entered the symbol if the input is not valid.
In order to work through the steps of creating a ticker symbol field, use an existing solution or create a new one.
Perform the following steps to customize a ticker symbol field on an Account form:
Ticker
, and set the Type to Single Line of Text and the Format to Ticker Symbol.OnChange
form field event.function CheckTicker() { var tickerValue = Xrm.Page.getAttribute("new_ticker").getValue(); if(!CheckTicker(tickerValue)) { alert("The Ticker symbol provided does not exist!"); } }
The function we just presented does nothing more than to read the user input value, and pass it to a custom CheckTicker()
function. We are expecting this function to return true if the value is a valid value, or false if not. Please customize this function according to the requirements of your environment. You can use some of the free web services available on the web for this validation, or use an internal application.
For an on-premise deployment, if you want to re-route your request to an internal application that provides ticker information, the configuration for the ticker symbol is located in an HTC file at the following location:
C:Program FilesMicrosoft Dynamics CRMCRMWeb\_static\_formcontrolsINPUT.text.ticker.htc
You can override the JScript function in that file, and replace the line with safeWindowOpen(Mscrm.CrmUri.create(…
to point to the URL of your custom application. This way, for an internal deployment where users are blocked from accessing the internet, the ticker link will forward them to your other internal application that provides stock information.
Please note that this customization is not supported, as it works using standard JavaScript and not the Dynamics CRM script API.
3.144.222.132