Created
August 26, 2016 10:36
-
-
Save gashupl/b294fdc6054e80897b7519ad1dee80e2 to your computer and use it in GitHub Desktop.
Dynamics CRM script presenting TurboForms OnChange events behavior
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function FormOnLoad(){ | |
var eventHandler = function(executionContext){ | |
alert(executionContext.getEventSource().getName()); | |
} | |
var attributes = Xrm.Page.getAttribute(); | |
attributes.forEach(function(element) { | |
element.addOnChange(eventHandler); | |
}); | |
var accountRef = new Array(); | |
accountRef[0] = new Object(); | |
accountRef[0].id = "D84CFC52-8E3F-E611-8138-00155D7BE808"; | |
accountRef[0].name = "Parent"; | |
accountRef[0].entityType = "account"; | |
Xrm.Page.getAttribute("new_text").setValue("Sample text"); | |
Xrm.Page.getAttribute("new_optionset").setValue(100000001); | |
Xrm.Page.getAttribute("new_bool").setValue(true); | |
Xrm.Page.getAttribute("new_int").setValue(1); | |
Xrm.Page.getAttribute("new_float").setValue(1); | |
Xrm.Page.getAttribute("new_decimal").setValue(1); | |
Xrm.Page.getAttribute("new_money").setValue(1); | |
Xrm.Page.getAttribute("new_multilinetext").setValue("Sample text"); | |
Xrm.Page.getAttribute("new_datetime").setValue(new Date()); | |
Xrm.Page.getAttribute("new_accountid").setValue(accountRef); | |
Xrm.Page.getAttribute("new_customer").setValue(accountRef); | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment