问题
ServiceNow - GetRecords
Code:
var proxy = new ServiceNow_dmn_demand()
{
Url = "https://<instance>.service-now.com/dmn_demand.do?SOAP",
Credentials = new NetworkCredential("username", "password")
};
var objRecord = new Service.getRecords
{
// Here, I want to filter the records that are approved..
};
var recordResults = proxy.getRecords(objRecord);
I am getting all the records.
I want to get the records that are only approved. But I don't know the exact field name used to filter the
Approved
records.
回答1:
You are looking for the state field, and specifically where state=8. This table extends the Task where the State field is defined. If you look at the choice list for that state field on task you will see value=8, has label of approved. If you query for only dmn_demand records where state = 8 this should give you what you want. Also consider using the ServiceNow REST API and the ServiceNow REST API Explorer (in Fuji release) to help you build and test these requests.
来源:https://stackoverflow.com/questions/29232613/getrecords-that-are-approved-in-servicenow-api