function retrieveworkorder() {
var ordernumber = Xrm.Page.data.entity.getId();
if (ordernumber != null) {
var fetchXml =
"<fetch mapping='logical'>" +
"<entity name='jmh_workorder'>" +
"<attribute name='jmh_workordernumber' />" +
"<filter>" +
"<condition attribute='jmh_bespokeorderid' operator='eq' value='" + ordernumber + "' />" +
"</filter>" +
"</entity>" +
"</fetch>";
var retrievedOrder = XrmServiceToolkit.Soap.Fetch(fetchXml);
// alert(retrievedOrder.length);
if (retrievedOrder.length > 0) {
Xrm.Page.ui.tabs.get("general").sections.get("workorder").setVisible(false);
}
}
}
Reference: http://xrmservicetoolkit.codeplex.com/wikipage?title=Soap%20Functions
No comments:
Post a Comment