Home > API General, Delinquency, Gates > SWS UpdateOverlockStatus Method

SWS UpdateOverlockStatus Method


Lets you change the overlock status for a rental item. Multiple rental items can be individually processed with a new status. If a rental item’s ID is passed in but a status does not get passed in, the status will default to NOT_OVERLOCKED.

Parameters

Name DataType Is Required
OrgID Long Required
Description The organization’s ID number.
RentalID Long Required
Description The rental item’s ID number. This is returned when using the MakeReservation method or can be searched for using the SearchBy method.
Status Status Required
Description The overlock status to which you are updating the rental item.
Available values:

  • NOT_OVERLOCKED
  • PENDING_OVERLOCK
  • OVERLOCKED
  • PENDING_LOCK_REMOVAL

Returned Parameters

Name Data Type
RentalID Long
Description The rental’s ID number.
Succeeded Boolean
Description Indicates if the update succeeded (“True”) or not (“False”).
ErrorMessage String
Description If the update wasn’t successful, you will get an error message with why the update was unsuccessful.

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, an UpdateOverlockStatus request object, and an UpdateOverlockStatus response object. We will also need an array of RentalOverLock objects. One for each rental to adjust. We can define and create those like this:

// Create a request and response objects
SWS.WSSoapClient service = new SWS.WSSoapClient();
SWS.UpdateOverlockStatus_Request request = new SWS.UpdateOverlockStatus_Request();
SWS.UpdateOverlockStatus_Response response;

SWS.RentalOverlockData[] overLock = new SWS.RentalOverlockData[1];

Here is a sample code of the request object:

// UpdateOverlockStatus Request
overLock[0].RentalID = 123456;
overLock[0].Status = SWS.OverlockStatus.OVERLOCKED;

request.OrgID = 123456;
request.OverlockData = overLock

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.UpdateOverlockStatus(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.

  1. No comments yet.
  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: