SWS UpdateUnitData Method
Update the unit information for a single unit. This will allow you to update all attributes, all dimensions, all rate types, notes on the unit, the unit number and the walk thru order number of the specified unit.
Parameters
Name | DataType | Is Required |
---|---|---|
AccessType | Integer | Optional |
Description | Updates the “AccessType” attribute to this new value. See eUnitAccessType for the available values. | |
Attribute01 | Integer | Optional |
Description | Updates the “Attribute01” attribute to this new value. See eUnitAttr01 for the available values. This value cannot be null. | |
Attribute02 | Integer | Optional |
Description | Updates the “Attribute02” attribute to this new value. See eUnitAttr02 for the available values. To set this to no value use -1. | |
Climate | Integer | Optional |
Description | Updates the “Climate” attribute to this new value. See eUnitClimate for the available values. To set this to no value use -1. | |
Depth | Decimal | Optional |
Description | Updates the depth of measurement of the unit. | |
Door | Integer | Optional |
Description | Updates the “Door” attribute to this new value. See eUnitDoor for the available values. To set this to no value use -1. | |
Features | Integer | Optional |
Description | Updates the “Features”attribute to this new value. See eUnitFeatures for the available values. To set this to no value use -1. | |
FutureEffectiveDate | DateTime | Optional |
Description | Sets the date the future rent rate will take effect. | |
FutureRate | Decimal | Optional |
Description | Updates the future rent rate for the rental item. For an explanation of rates see Terms and Accronyms. | |
Height | Decimal | Optional |
Description | Updates the height measurement of the rental item. | |
Notes | String | Optional |
Description | Updates the text that will be attached to the unit. This is displayed in the “Edit Rental Items” window in the notes box in Store. | |
ProformaRate | Decimal | Optional |
Description | Updates the proforma rate for the rental item. For an explanation of rates see Terms and Accronyms. | |
PushRate | Decimal | Optional |
Description | Updates the push rate for the rental item. For an explanation of rates see Terms and Accronyms. | |
RackRate | Decimal | Optional |
Description | Updates the rack rate for the rental item. For an explanation of rates see Terms and Accronyms. | |
SquareFeet | Decimal | Optional |
Description | Updates the total square foot measurement of the unit based on it’s width and depth. | |
Status | Integer | Optional |
Description | Updates the “Status” attribute to this new value. See eUnitStatus for the available values. | |
StreetRate | Decimal | Optional |
Description | Updates the street rate for the rental item. For an explanation of rates see Terms and Accronyms. | |
UnitID | Long | Required |
Description | This is returned when you use any of the GetSiteUnitData calls. This is maintained through rentals. |
|
UnitNumber | String | Optional |
Description | Updates the site assigned unit number of the rental item. | |
WalkThruOrder | Integer | Optional |
Description | Updates the walk thru order number. This is primarily used for a walkthru of the site by the manager. | |
Width | Decimal | Optional |
Description | Updates the width measurement of the rental item. |
Returned Parameters
Name | DataType |
---|---|
Succeeded | Boolean |
Description | Indicates if the unit data was updated successfully (“True”) or not (“False”). |
Example
As with every method we need to pass in credentials. We do this with the LookupUser request object.
We will assume you have a web reference, let us name it SWS, in your Visual Studio project. At this point we need to define our objects. We will need the standard service object, a UpdateUnitData request object, and a UpdateUnitData response object. We can define and create those like this:
// Create a request and response objects
SWS.WSSoapClient service = new SWS.WSSoapClient();
SWS.UpdateUnitData_Request request = new SWS.UpdateUnitData_Request();
SWS.UpdateUnitData_Response response;
Here is my sample requesting a change of the reserved unit.
// UpdateReservation request
request.UnitID = 123456;
request.Status = 5; //unavailable-damaged
Finally we can call the method and pass across the login object and the request object to retrieve our requested 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.UpdateUnitData(user_request, request);
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
Note that if something goes wrong the service will respond with an exception. You will want to capture the message in the exception so it can be debugged.
For a full list of methods see SWS Methods.