Hi,
I am facing some issues customizing javascript on crm 2016. Basically i need to raise an event on change of a custom field on lead form.
Here is my code:
var context = { loadFormContext: function (executionContext) { debugger; formContext = executionContext.getFormContext(); formContext.getAttribute("new_comune").addOnChangeEvent(this.onChangeComune); }, onChangeComune: function (executionContext) { var formContext = executionContext.getFormContext(); //DoSomething } }
I registered my functions on load events and change event on the lead form, flagging "pass the execution context as first parameter".
I am able to get in both functions debugging and i can see the executionContext object, it contains the global context but when i try to get the form context an error is handled "executionContext.getFormContext()is not a function".
I'm so confused, any suggestions?