Friday, July 8, 2016

Loop through Section and Page in CRM 2015

var requiredAttributeNames =[];
    XrmPage.ui.tabs.get("CL_Configurations").sections.get("CL_Configurations").controls.get(
    function (ctrl, i) {
      
        var ctrlname = ctrl.getName();
        requiredAttributeNames.push(ctrlname);
      
           
    });

    var preferredmethodofcontacttypes = requiredAttributeNames.indexOf("gw_preferredmethodofcontacttypes");
   // alert(preferredmethodofcontacttypes);
    var taskorigintypes = requiredAttributeNames.indexOf("gw_taskorigintypes");
    //alert(taskorigintypes);
   var relationtypes = requiredAttributeNames.indexOf("gw_relationshiptypes");



loop through page 




Xrm.Page.ui.controls.get(
function(ctrl,i){
 if(ctrl.getControlType() == "subgrid")
  console.log(ctrl.getName()
  );
});



Reference -  
https://msdn.microsoft.com/en-us/library/gg328261.aspx

https://msdn.microsoft.com/en-us/library/jj602964.aspx



No comments:

Post a Comment