I have a Two Option field, called new_bitfield, by default the bitfield is set to true, this was done when creating the field, as you have to select a default value, so I set it as "True".
My problem is this: I have an if/else function that executes code when a field value is changed:
function bitFieldTest() { if (Xrm.Page.getAttribute("new_bitfield").getValue() == false) { alert("false"); } else if (Xrm.Page.getAttribute("new_bitfield").getValue() == true) { // alert("true"); } }
If a user clicks on "True" in the Two Option field, I can't get the code to trigger an alert or execute the corresponding code. This is because the value was already set to "true", so there is no real change, thus the code is not executed. Is there a solution to this?