Announcements
I have a Check Box field on a Quick Create Lead form and I want to perform some action when ever this field is selected(Checked) on OnChange Event. I have created a JavaScript Web Resource and it is performing the action whenever the check box field is selected(Checked), but the problem here is that it is performing that action even when the check box field is Unchecked.
How to prevent that action while user is trying to Uncheck the check box field?
*This post is locked for comments
I applied the same function and it worked for me, thanks Radu
Hi Sunny,
This is expected behavior. The event handler is triggered on the on change event. Both checking and unchecking the box are considered on change events.
To prevent the logic from being executed when the box is unchecked, you can add some extra logic inside the onchage method and verify the value of the field. If it is null simply return.
Something llike
function OnChangehandler(){
var field = Xrm.Page.getAttribute("<your_checkboxfield">)
if(field==false){
return}
else{
//your logic here
}
}
Hope this helps,
Radu
André Arnaud de Cal...
293,399
Super User 2025 Season 1
Martin Dráb
232,548
Most Valuable Professional
nmaenpaa
101,158
Moderator