Using the FetchServiceReqValidationListData Web Method
4 min
returns the allowable validation list data for the specified service request parameter request syntax public frsheatfetchsrvallistdataresponse fetchservicereqvalidationlistdata(string sessionkey, string tenantid, string offeringname, string paramname, frsheatdepvalitem depvalitem = null, string substrmatch = "") parameters sessionkey the session key from the connect web method tenantid the tenant for which the session key is authenticated offeringname the name of the request offering paramname the name of the parameter in the request offering depvalitem an frsheatdepvalitem object, that represents the dependent validation item substrmatch a substring to match against the returned validation list items return value frsheatfetchsrvallistdataresponse object, defined as follows public class frsheatfetchsrvallistdataresponse { public string status { get; set; } public string exceptionreason { get; set; } public list\<frsheatvallistvalue> validationvalueslist { get; set; } } the frsheatfetchsrvallistdataresponse class has the following fields status provides a status about the state of the connection the table below contains a full description of the available status values exceptionreason contains exception information, if the application throws an exception when running this web method validationvalueslist contains a list of frsheatvallistvalue objects, each of which represents a record matching the specified search criteria the frsheatvallistvalue class is defined as follows public class frsheatvallistvalue { public string strrecid; public string strstoredvalue; public string strdisplayvalue; } the frsheatvallistvalue class has the following fields strrecid the recid corresponding to the validation list strstoredvalue the stored value of the validation list record for example, "asimon" if the validation list record corresponds to the "ashley simon" employee record strdisplayvalue the display value of the validation list record for example, "ashley simon" if the validation list record corresponds to the "ashley simon" employee record the following table lists the available status values and describes how to interpret them \<font color="#ffffff">status\</font>\<font color="#ffffff">explanation\</font> success successfully retrieved the service request with the specified numeric id this is available in the reqdata field notfound the tenant does not contain a service request with the specified numeric id ensure that the numeric id is spelled correctly error an error was encountered during the execution of this web method inspect the corresponding exceptionreason field to determine why the web method has failed example // fetch the matching validation list records for requester, in the // "domain password reset" request offering // since the requester is constrained by the "requesterdeparment" parameter, // this needs to be specified as an input parameter to the web method string offeringname = "domain password reset"; string paramname = "requester"; frsheatdepvalitem depvalitem = newfrsheatdepvalitem() { strparname = "requesterdepartment", strparvalue = "it" }; frsheatfetchsrvallistdataresponse validationvaluesresponse = frsvc fetchservicereqvalidationlistdata(authsessionkey, tenantid, offeringname, paramname, depvalitem, substrquery); frsheatvallistvalue\[] vallistvalues; if (validationvaluesresponse status == "success") { vallistvalues = validationvaluesresponse validationvalueslist; console writeline("here are the matching validation list records \n"); foreach (frsheatvallistvalue vallistitem in vallistvalues) { console writeline("stored value \\" \\"\t\tdisplay value \\" \\"", vallistitem strstoredvalue, vallistitem strdisplayvalue); } }
