SWS2 GetUnitData Method
If SiteIDs are provided then the result set will be those records matching the requested SiteIDs. Otherwise, the result set will be those records matching the specified search criteria.
Parameters
Name | Data Type | Is Required |
---|---|---|
AccessType | Integer | Optional |
Description | The numeric value for the “AccessType” custom look up as defined by the site. See eUnitAccessType for the available values. | |
Active | Boolean | Optional |
Description | Indicates if the unit is active (“True”) or not (“False”). | |
Attribute01 | Integer | Optional |
Description | The numeric value for the “Attribute01” custom look up as defined by the site. See eUnitAttr01 for the available values. | |
Attribute02 | Integer | Optional |
Description | The numeric value for the “Attribute0” custom look up as defined by the site. See eUnitAttr02 for the available values. | |
Channel | Integer | Optional |
Description | The indicator of what application is being used to pull the data. | |
ClassType | Integer | Optional |
Description | ||
Climate | Integer | Optional |
Description | The numeric value for the “Climate” custom look up as defined by the site. See eUnitClimate for the available values. | |
DepthDecimal | Decimal | Optional |
Description | The depth measurement of the unit. | |
Door | Integer | Optional |
Description | The numeric value for the “Door” custom look up as defined by the site. See eUnitDoor for the available values. | |
Feature | Integer | Optional |
Description | The numeric value for the “Features” custom look up as defined by the site. See eUnitFeatures for the available values. | |
HeightDecimal | Decimal | Optional |
Description | The height measurement of the unit. | |
MaxRentRate | Decimal | Optional |
Description | The maximum rent that can be charged for the unit type. | |
MinRentRate | Decimal | Optional |
Description | The minimum rent that can be charged for the unit type. | |
SiteID | Long | Required |
Description | The site’s ID number. This can be found using the GetSiteList method. |
|
Status | Integer | Optional |
Description | The numeric value for the “Status” custom look up as defined by the site. See eUnitStatus for the available values. | |
UnitIDs | Long (or an array of longs) | Optional |
Description | Adds a filter for the unit’s ID number. This is returned when you use any of the GetSiteUnitData calls and is maintained through rentals. |
|
UnitNumber | String | Optional |
Description | The unit’s number as assigned by the organization. This is not the UnitID. | |
WidthDecimal | Decimal | Optional |
Description | The width measurement of the unit. |
Returned Parameters
Name | Data Type |
---|---|
SITE_ID | Long |
Description | The site’s ID number. |
UNIT_ID | Long |
Description | The unit’s ID number. This is maintained through rentals. |
ORG_CLASS_ID | Long |
Description | The organization’s revenue class ID number. |
SITE_CLASS_ID | Long |
Description | The site’s revenue class ID number. |
CLASS_DESC | String |
Description | The description of the site’s revenue class. |
CLASS_REF | Integer |
Description | The reference number assigned by the system to the site’s revenue class. |
ICON | String |
Description | The name of the icon that is displayed in the Store application. |
CLASS_TYPE | Integer |
Description | The class of rental applicable to the unit. |
ACTIVE | Boolean |
Description | Indicates if the unit is active (“True”) or not (“False”). |
STATUS | Integer |
Description | The numeric indicator of the unit’s rental status. |
STATUS_VAL | String |
Description | The textual value of the unit’s rental status. |
UNIT_NUMBER | String |
Description | The unit’s number as assigned by the organization. This is not the UnitID. |
ATTRIBUTE01 | Integer |
Description | The numeric value for the “Attribute01” custom look up as defined by the site. |
ATTRIBUTE01_VAL | String |
Description | The textual value for the “Attribute01” custom lookup as defined by the site. |
ATTRIBUTE02 | Integer |
Description | The numeric value for the “Attribute02” custom look up as defined by the site. |
ATTRIBUTE02_VAL | String |
Description | The textual value for the “Attribute02” custom lookup as defined by the site. |
ACCESS_TYPE | Integer |
Description | The numeric value for the “AccessType” custom look up as defined by the site. |
ACCESS_TYPE_VAL | String |
Description | The textual value for the “AccessType” custom lookup as defined by the site. |
CLIMATE | Integer |
Description | The numeric value for the “Climate” custom look up as defined by the site. |
CLIMATE_VAL | String |
Description | The textual value for the “Climate” custom lookup as defined by the site. |
DOOR | Integer |
Description | The numeric value for the “Door” custom look up as defined by the site. |
DOOR_VAL | String |
Description | The textual value for the “Door” custom lookup as defined by the site. |
FEATURES | Integer |
Description | The numeric value for the “Features” custom look up as defined by the site. |
FEATURES_VAL | String |
Description | The textual value for the “Features” custom lookup as defined by the site. |
VOL_EXEMPT | Boolean |
Description | Indicates if the unit has volume (“True”) or not (“False”). |
PORTABLE | Boolean |
Description | Indicates if the unit is portable (“True”) or not (“False”). |
RENT_RATE | Decimal |
Description | The current rate at which the unit should be rented. |
OBJ_PERIOD | Integer |
Description | The length, in months, of the unit’s rental period. |
OBJ_PERIOD_UOM | Integer |
Description | The type of rental period that applies to the unit. |
OBJ_PERIOD_UOM_VAL | String |
Description | The textual value of the OBJ_PERIOD_UOM. |
OBJ_INV_FREQ | Integer |
Description | The number of months to include on the invoice. |
FOM_IND | Boolean |
Description | Indicates if the unit should be first of the month (“True”) or not (“False”). |
GP_MULTIPLIER | Decimal |
Description | This is the gross potential multiplier. This is used to calculate the potential earnings of the unit if the UOM is not just 1 month. |
WIDTH | Decimal |
Description | The width measurement of the unit. |
DEPTH | Decimal |
Description | The depth measurement of the unit. |
HEIGHT | Decimal |
Description | The height measurement of the unit. |
VOLUME | Decimal |
Description | The volume measurement of the unit. Calculated by multiplying the width, depth and height. |
SERIAL01 | Integer |
Description | Not currently used. |
SERIAL02 | Long |
Description | Not currently used. |
NOTES | String |
Description | Any notes that the site has added to the unit. |
WALK_THRU_ORDER | Integer |
Description | The order number where the unit falls during the walk through of the property. |
LINK_ID | Long |
Description | Not currently used. |
TAX_GROUP_ID | Long |
Description | The ID to the taxes that are charged to the unit. |
LEASE_GROUP_ID | Long |
Description | The ID to the group of documents generated at the time of lease. |
DEL_MODEL_ID | Long |
Description | The ID to the delinquency schedule used for the unit type. |
RES_GROUP_ID | Long |
Description | The ID to the applicable reservation deposit for the unit. |
DEP_GROUP_ID | Long |
Description | The ID to the applicable security deposit for the unit. |
MUX | Long |
Description | Not currently used. |
ALARM | Long |
Description | Not currently used. |
VERSION | Integer |
Description | The unit’s version number which serves to prevent duplicate use of the unit. |
FEE_OBJECT_ID | Long |
Description | The ID to the applicable administration fee for the unit. |
GATE_KEYPAD | Integer |
Description | The default gate keypad zone applicable to the unit. |
CREATED_BY | Long |
Description | The user’s ID that created the unit. |
UPDATED_BY | Long |
Description | The user’s ID that last updated the unit data. |
RES_AMOUNT | Decimal |
Description | The dollar amount of the reservation deposit. |
SQUARE_FEET | Integer |
Description | The area measurement of the unit. This is calculated by multiplying the width and the depth. |
PUSH_RATE | Decimal |
Description | The lowest rate at which the unit should be rented. |
Example
We’ll assume you’ve got a web reference, let’s name it Store, in your Visual Studio project. At this point we need to reference our objects. We’ll need the standard service object, a GetUnitData_Request request object. We can define and create those like this:
// Create a request and response objects
StoreServiceClient client = new StoreServiceClient();
GetUnitData_Request request = new GetUnitData_Request();
As with every method we need to pass in credentials. We also set up the parameters for our request.
client.ChannelFactory.Credentials.UserName.UserName = "user"; client.ChannelFactory.Credentials.UserName.Password = "pass"; client.ChannelFactory.Credentials.SupportInteractive = true; request.SiteID = 123456;
Finally we can call the method and pass across the login object and the request object to retrieve the data. It’s a good idea to do this in a Try Catch block.
try
{
// Call the method that will load the response object
System.Data.DataTable resp;
resp = client.GetUnitData(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 SWS2 Methods.