SWS GetUnitStatus Method
Returns a collection of rental item for all rental items with the specified overlock status.
Parameters
Name | DataType | Is Required |
---|---|---|
Filter | Integer | Required |
Description | Limits the rental items returned to those with the specified status. Available values:
|
|
OrgID | Long | Required |
Description | The organization’s ID number. | |
SiteID | Long | Required |
Description | The site’s ID number. This can be found using the GetSiteList method. |
Returned Parameters
Name | DataType |
---|---|
AccountID | Long |
Description | The account’s ID number. |
AccountName | String |
Description | The name on the account. This may differ from the primary contact’s name in some instances, such as a business account or a guardianship account. |
Attributes | String |
Description | The rental item’s attributes. |
DaysLate | String |
Description | The number of days that the rental item’s payment is past due. |
DelStep | Integer |
Description | The current delinquency step for the rental item. |
Dimensions | String |
Description | The dimensions for the rental item. |
PTD | DateTime |
Description | The paid-thru-date (PTD). |
Status | String |
Description | The textual value for the “Status” custom lookup as defined by the site. See eUnitStatus for the available values. |
UnitID | Long |
Description | The unit’s ID number. This is maintained through rentals. |
UnitNumber | String |
Description | The unit’s number as assigned by the organization. This is not the UnitID. |
Example
As with every method we need to pass in credentials. We do this with the LookupUser request object.
We’ll assume you’ve got a web reference, let’s name it SWS, in your Visual Studio project. At this point we need to our objects. We’ll need the standard service object, a GetUnitStatus request object and a GetUnitStatus response object. We can define and create those like this:
// Create a request and response objects
SWS.WSSoapClient service = new SWS.WSSoapClient();
SWS.GetUnitStatus_Request request = new SWS.GetUnitStatus_Request();
SWS.GetUnitStatus_Response response;
Here’s my sample code of the Request object.
// GetUnitStatus Request
request.OrgID = 123456;
request.SiteID = 123456;
request.Filter = 2;
Finally we can call the method and pass across the login object and the request object to get our unit status. It’s a good idea to do this in a Try Catch block.
// Call the method that will load the response object
try
{
response = service.GetUnitStatus(user_request, request);
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
Note that if something goes wrong the service will respond with an exception. You’ll want to take a look at that message returned in that exception so it can be debugged.
For a full list of methods see SWS Methods.