SWS getScheduledLetterList Method
Retrieves a list of letters scheduled to be created in the future. This list does not include receipts, invoices or lease documents.
Parameters
Name | DataType | Is Required |
---|---|---|
AcctID | Long | Required |
Description | The account’s ID number. This is returned when you use the CreateNewAccount method or can be retrieved with the SearchBy method. | |
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. | |
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. |
ACTIVE | Boolean |
Description | Indicates if the letter is active (“True”) or not (“False”). |
CERT_FLAG | Boolean |
Description | Indicates if the scheduled letter is flagged for certified mail (“True”) or not (“False”). |
LTR_NAME | String |
Description | The name of the letter. |
LTR_TYPE_ID | Long |
Description | The letter type’s ID number. |
MAIL_LOCAL | Boolean |
Description | Indicates if the letter will be printed and mailed by the site (“True”) or processed through centralized mailing (“False”). |
NOTES | String |
Description | The free text note associated with the account. |
PROCESSED_FLAG | Boolean |
Description | Indicates if the letter has bee processed (“True”) or not (“False”). |
RENTAL_ID | Long |
Description | The rental item’s ID number. |
SCHED_ID | Long |
Description | The scheduled letter’s ID number. |
SCHEDULED_DATE | DateTime |
Description | The date and time the scheduled letter will be mailed. |
SITE_ID | Long |
Description | The site’s ID number. |
WHO_CREATED | String |
Description | The Store user’s name that scheduled the letter. |
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 GetScheduledLetterList request object, and a GetScheduledLetterList response object. We can define and create those like this:
// Create a request and response objects
SWS.WSSoapClient service = new SWS.WSSoapClient();
SWS.getScheduledLetterList_Request request = new SWS.getScheduledLetterList_Request();
SWS.getScheduledLetterList_Response response;
Here’s my sample code of the Request object.
// GetScheduledLetterList Request
request.SiteID = 123456;
request.AcctID = 123456;
request.RentalID = 123456;
Finally we can call the method and pass across the login object and the request object to retrieve the scheduled letters for the specified rental. 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.getScheduledLetterList(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 returned in that exception so it can be debugged.
For a full list of methods see SWS Methods.