Hi Expert,
Is there a way to get all status reasons filtered by a status in a web API metadata call.
e.g: I need all status reason for lead entity filtered by status "DisQualify".
Thanks in Advance.
*This post is locked for comments
Hi Expert,
Is there a way to get all status reasons filtered by a status in a web API metadata call.
e.g: I need all status reason for lead entity filtered by status "DisQualify".
Thanks in Advance.
*This post is locked for comments
Did you try querying statusmap or picklistmapping entity?
deleted
Waheed thanks for your response - But I don't need to filter records by status.
Actually I was in need to get all status reasons against a status for a specific entity from metadata. We can get status reasons for an entity and then we can filter the return data by statecode as I have explained it here siddiquemahsud.blogspot.com/.../get-status-reasons-statuscode-for.html
var req = new XMLHttpRequest();
req.open("GET", Xrm.Page.context.getClientUrl() + "/api/data/v8.2/leads?$select=statuscode&$filter=statuscode eq 3", false);
req.setRequestHeader("OData-MaxVersion", "4.0");
req.setRequestHeader("OData-Version", "4.0");
req.setRequestHeader("Accept", "application/json");
req.setRequestHeader("Content-Type", "application/json; charset=utf-8");
req.setRequestHeader("Prefer", "odata.include-annotations=\"*\"");
req.onreadystatechange = function() {
if (this.readyState === 4) {
req.onreadystatechange = null;
if (this.status === 200) {
var results = JSON.parse(this.response);
for (var i = 0; i < results.value.length; i++) {
var statuscode = results.value[i]["statuscode"];
}
} else {
Xrm.Utility.alertDialog(this.statusText);
}
}
};
req.send();
Stay up to date on forum activity by subscribing. You can also customize your in-app and email Notification settings across all subscriptions.
André Arnaud de Cal... 291,280 Super User 2024 Season 2
Martin Dráb 230,214 Most Valuable Professional
nmaenpaa 101,156