Hello,
I am trying to have a template for JS file. I have a lot of functions I want to run on load, change, and Save. I have created the below I am getting error message "executionContext Undefined at hideShow". Thank you for the help.
// JavaScript source code if (typeof DEMO == "undefined") { DEMO = { __namespace: true }; } DEMO.Case = (function () { var $self = {}; var formContext = executionContext.getFormContext(); //debugger; //onLoad $self.onLoad = function () { // var formContext = executionContext.getFormContext(); hideShow(executionContext); } //onSave $self.onSave = function () { //LoadFormContext(formContext); } //OnChange Events $self.OnChange = function () { //LoadFormContext(formContext); hideShow(executionContext); } function hideShow() { var formContext = executionContext.getFormContext(); if (formContext.getAttribute("fieldName").getValue() == "") { formContext.ui.tabs.get("tabName").setVisible(false); } else formContext.ui.tabs.get("tabName").setVisible(true); } return $self; })();
*This post is locked for comments
Yes, I have tried that as well, also read the article
/ JavaScript source code if (typeof DEMO == "undefined") { DEMO = { __namespace: true }; } DEMO.Case = (function () { var $self = {}; var formContext = executionContext.getFormContext(); //debugger; //onLoad $self.onLoad = function () { // var formContext = executionContext.getFormContext(); hideShow(executionContext); } //onSave $self.onSave = function () { //LoadFormContext(formContext); } //OnChange Events $self.OnChange = function () { //LoadFormContext(formContext); hideShow(executionContext); } function hideShow(executionContext) { var formContext = executionContext.getFormContext(); if (formContext.getAttribute("fieldName").getValue() == "") { formContext.ui.tabs.get("tabName").setVisible(false); } else formContext.ui.tabs.get("tabName").setVisible(true); } return $self; })();
Hi,
You need to pass execution context as parameter to your method, I will suggest you to check read this :community.dynamics.com/.../executioncontext-hits-the-big-time
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,240 Super User 2024 Season 2
Martin Dráb 230,149 Most Valuable Professional
nmaenpaa 101,156