Archive
SWS GetRentalActivityUnitLevel Method
This method returns rental activity by unit type over a specified date range.
Parameters
Name | DataType | Is Required |
---|---|---|
OrgID | Long | Required |
Description | The organization’s ID number. | |
StartDate | DateTime | Required |
Description | The first date of the date range to include in the report. | |
EndDate | DateTime | Required |
Description | The last date of the date range to include in the report. |
Returned Parameters
Name | DataType |
---|---|
SiteNumber | String |
Description | The organization assigned site number. This is not the site ID. |
SiteName | String |
Description | The site’s name as it appears in Store. |
ExportDate | DateTime |
Description | The date the data was retrieved. |
DateRange | String |
Description | The start and end dates of the requested report. |
Dimensions | String |
Description | The dimensions of the unit group. |
TotalUnits | Long |
Description | The total number of units in the unit group. |
BegOccUnits | Long |
Description | The number of occupied units on the first date in the date range for the group. |
NewRentals | Long |
Description | The total number of new rentals during the date range for the group. |
VacantUnits | Long |
Description | The current number of vacant units for the group. |
SqFtOcc | Decimal |
Description | The total number of square feet currently occupied for the group. |
StreetRate | Decimal |
Description | The street rate for the unit group. |
AverageRentRate | Decimal |
Description | The average rent rate for the unit group. |
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 GetRentalActivityUnitLevel request object and a GetRentalActivityUnitLevel response object. We can define and create those like this:
// Create a request and response objects
SWS.WSSoapClient service = new SWS.WSSoapClient();
SWS.GetRentalActivityUnitLevel_Request request = new SWS.GetRentalActivityUnitLevel_Request();
SWS.GetRentalActivityUnitLevel_Response response;
Here’s my sample code of the Request object.
// GetRentalActivityUnitLevel Request
request.OrgID = 123456;
request.StartDate = new DateTime().AddDays(-30);
request.EndDate = new DateTime();
Finally we can call the method and pass across the login object and the request object to get our account information. 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.GetRentalActivityUnitLevel(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.
SWS2 GetDataView Method – sws_new_rentals_v
This is the same view that is used in the “New Rental” report and provides a list of new rentals. This is available at the organization or site level.
Returned Columns
Name | Data Type |
---|---|
UNIT_NUMBER | String |
Description | The unit’s number as assigned by the organization. This is not the UnitID. This can be retrieved using any of the GetSiteUnitData methods. |
UNIT_ID | Long |
Description | The unit’s ID number. This is maintained through rentals. |
WIDTH | Integer |
Description | The width measurement of the unit dimensions. |
DEPTH | Integer |
Description | The depth measurement of the unit dimensions. |
AVGLOS | Decimal |
Description | The average length of stay, in months, of the tenants in this unit. |
HEIGHT | Integer |
Description | The height measurement of the unit dimensions. |
DIM_ATTRIB | String |
Description | The width and depth dimensions as well as the “Attribute01” as a string. |
RENTAL_START_DATE | DateTime |
Description | The date and time that the customer initiated the rental. |
RENT_RATE | Decimal |
Description | The rate at which the unit was rented. |
ACCT_ID | Long |
Description | The account’s ID number. |
ACCOUNT_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 guardian account. |
FIRST_NAME | String |
Description | The first name of the primary contact. |
LAST_NAME | String |
Description | The last name of the primary contact. |
String | |
Description | The email of the primary contact. |
ADDRESS | String |
Description | A combination of all three address lines of the primary contact’s address |
CITY | String |
Description | The city of the primary contact’s address. |
STATE | String |
Description | The state/province of the primary contact’s address. |
POSTAL_CODE | String |
Description | The ZIP/postal code of the primary contact’s address. |
PHONE | String |
Description | The primary conact’s phone number. |
MOVED_IN_BY | String |
Description | The first and last name of the user that moved the customer into the unit. |
SITE_ID | Long |
Description | The site’s ID number |
SITE_NAME | String |
Description | The site’s name. |
ORG_ID | Long |
Description | The organization’s ID number. |
START_DATE | DateTime |
Description | The date the customer started the rental. |
CLASS_DESC | String |
Description | The textual description for the class type of the unit. |
ORG_NUMBER_XREF | String |
Description | The organization’s site number. This is not the site ID. |
CURR_STATUS | String |
Description | The current rental status of the specific unit. |
END_DATE | DateTime |
Description | If the rental has been terminated, this is the date the the rental was terminated. |
UNIT_NUM_SORT | String |
Description | A number used to allow us to sort the units in the application. |
SWS2 GetDataView Method – sws_rental_prospects_v
Allows you to retrieve a list of quoted, soft-reserved and hard-reserved reservations. This view requires at least one parameter by which to filter.
Returned Columns
Name | Data Type |
---|---|
SITE_ID | Long |
Description | The site’s ID number. This can be found using the GetSiteList method. |
SITE_NUMBER | String |
Description | The organization assigned site number. This is not the site ID. |
ACCT_ID | Long |
Description | The account’s ID number. This is returned when you use the CreateNewAccount method or can be retrieved with the SearchBy method. |
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. |
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. |
RENTAL_ID | Long |
Description | The rental item’s ID number. This is returned when using the MakeReservation method or can be searched for using the SearchBy method. |
RESERVATION_DATE | DateTime |
Description | The date the quote/reservation was originally created. |
PAID_THRU_DATE | DateTime |
Description | If the unit has been rented, this is the date the customer has paid through. |
QUOTE_ID | Long |
Description | The quote/reservation’s ID number. |
SITE_CLASS_ID | Long |
Description | The ID of the class to which the unit belongs. |
EXPIRATION | DateTime |
Description | The date the quote/reservation will no longer be available. |
QUOTE_STATUS | Integer |
Description | The numeric value for the status of the quote/reservation.
|
QUOTE_STATUS_VALUE | String |
Description | The textual value for the status of the quote/reservation. |
QUOTE_TYPE | Integer |
Description | The type of quote/reservation that was created.
|
QUOTE_TYPE_VALUE | String |
Description | The textual value for the QUOTE_TYPE of the reservation. |
ATTRIBUTE01 | Integer |
Description | The numeric value for the “Attribute01” custom look up as defined by the site. See eUnitAttr01 for the available values. |
ATTRIBUTE01_VAL | String |
Description | The textual value for the “Attribute01” custom lookup as defined by the site. See eUnitAttr01 for the available values. |
ATTRIBUTE02 | Integer |
Description | The numeric value for the “Attribute02” custom look up as defined by the site. See eUnitAttr02 for the available values. |
ATTRIBUTE02_VAL | String |
Description | The textual value for the “Attribute02” custom look up as defined by the site. See eUnitAttr02 for the available values. |
CLIMATE | Integer |
Description | The textual value for the “Climate” custom lookup as defined by the site. See eUnitClimate for the available values. |
CLIMATE_VAL | String |
Description | The numeric value for the “Climate” custom look up as defined by the site. See eUnitClimate for the available values. |
WIDTH | Integer |
Description | The width measurement of the unit. |
DEPTH | Integer |
Description | The depth measurement of the unit. |
SQ_FEET | Integer |
Description | The total square feet of the unit, calculated by multiplying the width and the depth measurements. |
FEATURES | Integer |
Description | The numeric value for the “Features” custom look up as defined by the site. See eUnitFeatures for the available values. |
FEATURES_VAL | String |
Description | The textual value for the “Features” custom lookup as defined by the site. See eUnitFeatures for the available values. |
ACCESS_TYPE | Integer |
Description | The numeric value for the “Access Type” custom lookup as defined by the site. See eUnitAccessType for the available values. |
ACCESS_TYPE_VAL | String |
Description | The textual value for the “Access Type” custom lookup as defined by the site. See eUnitAccessType for the available values. |
DOOR | Integer |
Description | The numeric value for the “Door” custom look up as defined by the site. See eUnitDoor for the available values. |
DOOR_VAL | String |
Description | The textual value for the “Door” custom look up as defined by the site. See eUnitDoor for the available values. |
PRICE | Decimal |
Description | The price quoted in the quote/reservation. |
START_RENT_RATE | Decimal |
Description | The applicable starting rent rate of the unit. |
PRORATE_AMT | Decimal |
Description | The amount that will be paid, in rent, at the time of the move-in. This is based on today’s date any discounts that were quoted at the time the quote/reservation was created. |
LOST_DEMAND_REASON | Integer |
Description | The customizable reason that the customer didn’t complete a rental for a unit. Contact the organization for the list. |
INQUIRY_SOURCE | Integer |
Description | The customizable list of ways that a customer heard about the organization/site. Contact the organization for the list. |
ADMIN_FEE | Decimal |
Description | A fee assessed to cover the administrative costs of setting up the rental. |
TAX | Decimal |
Description | The tax applicable to the unit. This is based on the prorated amount. |
DEPOSIT | Decimal |
Description | The security deposit due at the time of rental. |
RES_DEPOSIT | Decimal |
Description | The amount required to hold the reservation. This can only be applied to soft and hard reservations. |
DISC_AMT | Decimal |
Description | The dollar amount of any applicable discounts that have been quoted. |
TOT_AMT | Decimal |
Description | The total amount due at the time of move-in based on the prorated amount, the applicable taxes and any discounts that apply. |
QUOTE_START_DATE | DateTime |
Description | The date the quote/reservation was created. |
CFLEX01 | String |
Description | A custom field, set up by the organization, designed to hold additional account level information. This is displayed in the “Account Information” tab of the account in the Store application. |
CFLEX02 | String |
Description | A custom field, set up by the organization, designed to hold additional account level information. This is displayed in the “Account Information” tab of the account in the Store application. |
CFLEX03 | String |
Description | A custom field, set up by the organization, designed to hold additional account level information. This is displayed in the “Account Information” tab of the account in the Store application. |
CFLEX04 | String |
Description | A custom field, set up by the organization, designed to hold additional account level information. This is displayed in the “Account Information” tab of the account in the Store application. |
CFLEX05 | String |
Description | A custom field, set up by the organization, designed to hold additional account level information. This is displayed in the “Account Information” tab of the account in the Store application. |
CHANNEL | Integer |
Description | The means by which the user has access to the store application. Contact the organization for the available options. |
MKT_CODE | Integer |
Description | Similar to the inquiry source, this is a custom field to describe how the customer heard about the organization site. |
MKT_SOURCE | String |
Description | Similar to the inquiry source, this is a custom field to describe how the customer heard about the organization site. |
QUOTE_CREATED | DateTime |
Description | The date the quote/reservation was originally created. |
QUOTE_UPDATED | DateTime |
Description | The date the quote/reservation was last updated. |
QUOTE_CREATED_BY | Long |
Description | The user’s ID number that created the quote/reservation. |
QUOTE_UPDATED_BY | Long |
Description | The user’s ID number that last updated the quote/reservation. |
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 GetDataView_Request request object and a ParameterValues object. You will also need to pass in credentials. We can define and create those like this:
// Create a request and response objects
StoreServiceClient client = new StoreServiceClient();
GetDataView_Request request = new GetDataView_Request();
ParameterValues parms = new Store.ParameterValues();
As with every method we need to pass in credentials. We also set up the parameters for our request.
//get data view setup
client.ChannelFactory.Credentials.UserName.UserName = "user";
client.ChannelFactory.Credentials.UserName.Password = "pass";
client.ChannelFactory.Credentials.SupportInteractive = true;
parms.FilterType = 3;
parms.ParameterName = "quote_created";
parms.ParameterValue = "01-MAR-2017";
request.OrgID = 123456;
request.SiteID = 123456;
request.ViewName = "sws_rental_prospects_v";
request.Parameters = new ParameterValues[] { parms };
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
object resp;
resp = client.GetDataView(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.
SWS2 GetDataView Method
This method is designed to allow access to specific database views to retrieve data. This method was created so that when a data set not currently available in reports or other functions is required, the view can be created within the database and accessed without creating additional API methods. This method does not do any logic, it simply retrieves the view based on the parameters specified. Each view will have a unique parameter collection and that information will need to be obtained from Yardi before the view can be accessed. The parameters collection will need a parameter object that includes filter type (equal, not equal, greater than, etc.), the parameter name which is the field name in the view, and the parameter value which is the value on which to filter. The data is returned as a serialized DataTable.
Parameters
Name | DataType | Is Required |
---|---|---|
OrgID | Long | Required |
Description | The organization ID number for which you are accessing the data. | |
SiteID | Long | Optional* |
Description | The site’s ID number. This can be found using the GetSiteList method. *This is required if the view is a site level only view. |
|
ViewName | String | Required |
Description | This is a list of currently available views:
|
|
FilterType | Decimal | Required |
Description | Selects the type of filter to use in the search. Available filter values:
|
|
ParameterName | String | Required |
Description | Indicates the name of the parameter for which you wish to apply the filter. See the ViewName above for the available parameters. | |
ParameterValue | String | Required |
Description | Indicates the value of the parameter for which you wish to apply the filter. |
Returns
Name | DataType |
---|---|
GetDataViewResult | DataTable |
Description | A data table that contains all rows meeting the filter parameters. |
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 create our objects. We’ll need the standard service object, a GetDataView request object that contains one or more ParameterValues object(s) and a DataTable object for the response. We can define and create those like this:
// Create a request and response objects
Store.GetDataView_Request request = new Store.GetDataView_Request();
Store.ParameterValues params1 = new Store.ParameterValues();
Store.ParameterValues params2 = new Store.ParameterValues();
System.Data.DataTable resp = new System.Data.DataTable();
Now we set up the parameters for our request. Each parameter you are filtering by should have a filter type (listed below), a parameter name which is the name of the field you wish to filter on (click on view names above for the list of available fields) and the value on which to filter.
//Add deposit request object
params1.FilterType = 3;
params1.ParameterName = "end_date";
params1.ParameterValue = DateTime.Today.AddDays(-30).ToString();
params2.FilterType = 5;
params2.ParameterName = "end_date";
params2.ParameterValue = DateTime.Today.ToString();;
request.OrgID = 123456;
request.SiteID = 123456;
request.ViewName = "move_out_list_v";
request.Parameters = new Store.ParameterValues[] { params1, params2};
Finally we can call the method and pass in the request object to retrieve our data table. It’s a good idea to do this in a Try Catch block.
// Call the method that will load the data
try
{
resp = client.GetDataView(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.