Tuesday, March 15, 2016

Get View ID Based on View Name MSCRM 2013 & CRM 2015

Hi All,

Get View ID Based on Name


GetViewIdByName("ViewName");

function GetViewIdByName(viewName) {
    var viewId = "";
    var fetchXml =
       "<fetch mapping='logical'>" +
          "<entity name='savedquery'>" +
          "<attribute name='savedqueryid' />" +
          "<filter>" +
          "<condition attribute='name' operator='eq' value='" + viewName + "' />" +
          "</filter>" +
          "</entity>" +
       "</fetch>";

    var retrievedViews = XrmServiceToolkit.Soap.Fetch(fetchXml);
    viewId = retrievedViews[0].attributes['savedqueryid'].value;
    return viewId;
}

No comments:

Post a Comment

How to Run Microsoft Flow for Every one Month

Introduction: In this Blog we will see how to Run Microsoft Flow for Every one Month. Implementation Steps:   1. Navigate to  https://make.p...