Hi,
while changing the option set values i need to pass the selected value into Web Resource dynamically.
have anyone tried it before or is this achievable?
*This post is locked for comments
Hi,
while changing the option set values i need to pass the selected value into Web Resource dynamically.
have anyone tried it before or is this achievable?
*This post is locked for comments
Hi Ram,
sure it is.. In the web resource, you can access form methods through window.parent
So, define a function in the htmlweb resource:
function onChangeValue(updatedValue)
{
...
}
then, either in the body.onload for the html web resource.. or, possibly, just in the end of that html, do this:
window.parent.AddWebResourceOnChange(onChangeValue);
Finally, add a javscript web resource to your form:
var onChangeHandler = null;
function AddWebResourceOnChange(handler)
{
onChangeHandler = value;
}
function CallChangeHandler()
{
var updatedValue = Xrm.Page.getAttribute(...).getValue();
onChangeHandler(updatedValue);
}
And add an event handler to the field (use CallChangeHandler function for that)
Hi Ram,
From the form you can set the parameter value "OnChange" of the option set value, that calls web resource function with parameter. Select the option set control in design view and use the change properties from the ribbon to set the parameter values from the even tab of change properties. (Change Properties => Events => On Change => Add Handler ("+"))
Stay up to date on forum activity by subscribing. You can also customize your in-app and email Notification settings across all subscriptions.
André Arnaud de Cal... 291,269 Super User 2024 Season 2
Martin Dráb 230,198 Most Valuable Professional
nmaenpaa 101,156