Quantcast
Channel: Microsoft Dynamics CRM Forum - Recent Threads
Viewing all articles
Browse latest Browse all 82002

Creating a namspace defined JS library template

$
0
0

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;



})();



Viewing all articles
Browse latest Browse all 82002

Latest Images

Trending Articles



Latest Images