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