SWS GetPrimaryRentalInfo Method
Retrieves rental data for a specified rental or a collection of rental data for a specified contact or account.
Parameters
Name | DataType | Is Required |
---|---|---|
AccountID | 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. | |
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. | |
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. | |
SiteID | Long | Required |
Description | The site’s ID number. This can be found using the GetSiteList method. |
Returned Parameters
Name | DataType |
---|---|
ACCT_ID | Long |
Description | The account’s ID number. |
ACCT_NAME | 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. |
ACCT_TYPE | String |
Description | The system-defined account type. |
ADDR1 | String |
Description | The first address line of the account address. |
ADDR2 | String |
Description | The second address line of the account address. |
ADDR3 | String |
Description | The third address line of the account address. |
ADDRESS_TYPE | String |
Description | The address type of the account address. |
ATTRIBUTE01_VAL | String |
Description | The textual value for the “Attribute01” custom lookup as defined by the site. See eUnitAttr01 for the available values. |
CITY | String |
Description | The city of the account address. |
CONTACT_ID | Long |
Description | The rental contact’s ID number. |
CONTACT_TYPE | String |
Description | The contact’s type. Available values:
|
COUNTRY | String |
Description | The country of the account address, if one is included. |
CURRENTLY_RENTED | String |
Description | Indicates if the unit is currently rented (“Y”) or not (“N”). |
DEL_EXEMPT | String |
Description | Indicates if they are exempt from the delinquency (“Y”) or not (“N”). |
DEL_STEP | Integer |
Description | The current delinquency step for the rental item. If the unit is not rented this will return “0”. |
DEPTH | Decimal |
Description | The depth measurement of the rental item. |
String | |
Description | The rental contact’s email address. This is also used as the username if the site supports eStore. |
FIRST_NAME | String |
Description | The given name for the account/rental contact. |
KNOWN_AS | String |
Description | The alternate or nick name, if there is one, for the rental contact. |
LAST_NAME | String |
Description | The family name for the rental contact. |
LTD | DateTime |
Description | The lease-thru-date (LTD). |
MO_DATE | DateTime |
Description | The scheduled date of the move-out, if it has been provided and documented in the rental details. |
OBJ_PERIOD | Long |
Description | The number of periods which apply to the UOM (unit of measure). |
OBJ_PERIOD_UOM | String |
Description | The description of the UOM (unit of measure). This will always be “Month”. |
OVERLOCK_STATUS | String |
Description | The current overlock status of the rental. Available values:
|
PHONE | String |
Description | The primary contact’s phone number. |
PHONE_TYPE | String |
Description | The type of phone number. Available values:
|
POSTAL_CODE | String |
Description | The postal/ZIP code for the contacts address. |
PTD | DateTime |
Description | The date through which the rental is currently paid. |
RENTAL_ID | Long |
Description | The rental item’s ID number. |
RENTAL_STATUS | String |
Description | The textual value for the “Status” custom lookup as defined by the site. See eUnitStatus for the available values. |
SITE_ID | Long |
Description | The site’s ID number. |
START_DATE | DateTime |
Description | The date the rental was first rented. |
STATE | String |
Description | The state/province for the address. |
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. |
WIDTH | Decimal |
Description | The width measurement of the rental item. |
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 GetPrimaryRentalInfo request object and a GetPrimaryRentalInfo response object. We can define and create those like this:
// Create a request and response objects
SWS.WSSoapClient service = new SWS.WSSoapClient();
SWS.GetPrimaryRentalInfo_Request request = new SWS.GetPrimaryRentalInfo_Request();
SWS.GetPrimaryRentalInfo_Response response;
To establish a contact we need to pass the AccountID, ContactID or RentalID, and SiteID. Here’s my sample code of the Request object using RentalID.
// GetPrimaryRentalInfo Request
request.SiteID = 123456;
request.RentalID = 123456;
Finally we can call the method and pass across the login object and the request object to get our primary 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.GetPrimaryRentalInfo(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.
Updated Oct. 15, 2015: Previously this function was not returning a record if the account did not have a phone number attached to the rental. After the update you will always get a record returned and the corresponding phone number fields will be null. This was a database change and will not require any adjustments to how GetPrimaryRentalInfo is used.