SWS GetRentalInfo Method
Retrieves the list of IDs for the specified information. This only retrieves information for active rentals.
Parameters
Name | DataType | Is Required |
---|---|---|
AcctID | Long | Optional* |
Description | The account’s ID number. This is returned when you use the CreateNewAccount method or can be retrieved with the SearchBy method. * Only one input is required and only one input option should be used. |
|
ContactID | Long | Optional* |
Description | The rental contact’s ID number. This is returned when using the CreateNewAccount or AddNewContact methods or you can search for it using the SearchBy method. * Only one input is required and only one input option should be used. |
|
RentalID | Long | Optional* |
Description | The rental item’s ID number. This is returned when using the MakeReservation method or can be searched for using the SearchBy method. * Only one input is required and only one input option should be used. |
|
UnitID | Long | Optional* |
Description | The unit’s ID number. This is returned when you use any of the GetSiteUnitData calls and is maintained through rentals. * Only one input is required and only one input option should be used. |
Returned Parameters
Name | DataType |
---|---|
ACCT_ID | Long |
Description | The account’s ID number. |
CONTACT_ID | Long |
Description | The rental contact’s ID number. |
LTD | DateTime |
Description | The lease-thru-date (LTD). |
PTD | DateTime |
Description | The paid-thru-date (PTD). |
RENTAL_ID | Long |
Description | The rental item’s ID number. |
SITE_ID | Long |
Description | The site’s ID number. |
STATUS | Integer |
Description | The rental’s current status. Available values:
|
UNIT_ID | Long |
Description | The unit’s ID number. This is maintained through rentals. |
UNIT_NUMBER | 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 GetRentalInfo request object and a GetRentalInfo response object. We can define and create those like this:
' Create a request and response objects
SWS.WSSoapClient service = new SWS.WSSoapClient();
SWS.GetRentalInfo_Request request = new SWS.GetRentalInfo_Request();
SWS.GetRentalInfo_Response response;
Here’s my sample code of the Request object using the AcctID option. Only one of the four options should be used.
// GetRentalInfo Request
request.AcctID = 123456;
Finally we can call the method and pass across the login object and the request object to get our rental info. 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.GetRentalInfo(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.