Using the FindBusinessObject Web Method
3 min
returns a single business object using its primary identifier (recid field) in the database request syntax frsheatintegrationfindboresponse findbusinessobject(string sessionkey, string tenantid, string botype, string recid) parameters sessionkey the session key from the connect web method tenantid the tenant for which the session key is authenticated botype the type of business object to retrieve recid the unique identifier for the business object return value frsheatintegrationfindboresponse object, defined as follows public class frsheatintegrationfindboresponse { public string status { get; set; } public string exceptionreason { get; set; } public webservicebusinessobject obj { get; set; } } the frsheatintegrationfindboresponse class has the following fields status provides a status value indicating whether the operation was successful a full description of the available status values is provided in the table below exceptionreason contains exception information, if the application throws an exception when running the connect web method obj the field by which the business object can be accessed, if the exact record is found via the findbusinessobject web method (that is, if the value of the status field is success ) the following table lists the available status values and describes how to interpret them status \<font color="#ffffff">explanation\</font> success successfully found the business object access the business object from the obj field error cannot find the business object the obj field is null inspect the corresponding exceptionreason field to determine why the web method failed one typical error is table not found , which occurs when the specified business object does not exist in the tenant ensure that the name of the business object is spelled properly notfound the specified business object exists in the tenant, but the specified recid does not match any of the existing records in the object since this is not an exceptional condition, no exception is stored in the exceptionreason field but the obj field is null ensure that the recid for the intended record exists in the tenant consider using a different web method, such as findsinglebusinessobjectbyfield example frsheatintegrationfindboresponse res = frsvc findbusinessobject(authsessionkey, tenantid, "incident", "a981fbebaa8b4ee2820364505855abc2"); if (res status == "success") { foreach (webservicefieldvalue f in res obj fieldvalues) { if (string compare(f name, "lastmoddatetime", true) == 0) { datetime lastmod; if (f value != null) { lastmod = (datetime)f value; console writeline("the lastmoddatetime of the record is " + lastmod tostring()); } } } }
