Archive
SWS SearchBy Method
Allows you to search for a customer name, unit number, phone number, or rental ID. The search can be performed for the entire organization or for just a specific site. This will return a record for each contact and each rental on an account.
Parameters
Name | DataType | Is Required |
---|---|---|
OrgID | Long | Optional* |
Description | The organization’s ID number. *Either an OrgID or SiteID is required. |
|
SearchTerm | String | Required |
Description | The parameter to search for. | |
SearchType | SearchTypes | Required |
Description | Tells the system what fields to look at in the search. Available values:
|
|
SiteID | Long | Optional* |
Description | The site’s ID number. This can be found using the GetSiteList method. *Either an OrgID or SiteID is required. |
Returned Parameters
Name | DataType |
---|---|
ACCT_CONTACT_NAME_SEARCH | String |
Description | The field in Store used when an “Account/Contact” search is performed. |
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. |
AFFILIATE_ID | Long |
Description | The affiliated organization’s ID number. |
BASIC_NAME_SEARCH | String |
Description | The field in Store used when an “Account Name” search is performed. |
CONTACT_FULL_NAME | String |
Description | The full name of the contact in the format of “First Last”. |
CONTACT_ID | Long |
Description | The rental contact’s ID number. |
DISPLAY_RENTAL_STR | String |
Description | The display name of the rental as it appears in Store. |
FIRST_NAME | String |
Description | The first name of the contact. |
LAST_NAME | String |
Description | The family or last name of the contact. |
NETWORK_NAME_SEARCH | String |
Description | The organization’s search field which includes the account name, the organization name and the site name. |
OBJECT_ID | Long |
Description | The object’s ID number. This is maintained through rentals. |
ORG_ID | Long |
Description | The organization’s ID number. |
PHONE | String |
Description | The contact’s phone number. |
PHONE_CONTACT_NAME_SEARCH | String |
Description | One of the fields in Store used when a “Phone Number” search is performed. |
PHONE_SEARCH | String |
Description | One of the fields in Store used when a “Phone Number” search is performed. |
PHONE_TYPE | String |
Description | Describes the type of phone number returned for the contact. Available values:
|
PTD | DateTime |
Description | The PTD of the returned rental. |
QUICK_SEARCH | String |
Description | The field in Store used when an “Quick Search” search is performed. |
RENTAL_ID | Decimal |
Description | The rental record’s ID number. |
RENTAL_STATUS | Integer |
Description | The textual value for the rental status of the rental. Available values:
|
RSTAT_RAW | Decimal |
Description | The numeric value for the rental status of the rental. Available values:
|
SITE_ID | Long |
Description | The site’s ID number where the unit is located. |
SITE_NAME | String |
Description | The site’s name where the unit is located. |
UNIT_NUMBER | String |
Description | The unit’s number as assigned by the organization. This is not the UnitID. |
UNIT_SEARCH | String |
Description | The field in Store used when a “Unit Number” search is performed. |
UNIT_STATUS | String |
Description | The rental status of the unit. Available values:
|
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 SearchBy request object, and a SearchBy response object. We can define and create those like this:
// Create a request and response objects
SWS.WSSoapClient service = new SWS.WSSoapClient();
SWS.SearchBy_Request request = new SWS.SearchBy_Request();
SWS.SearchBy_Response response;
Here is a sample code of the request object for the QuickSearch option:
// SearchBy Request
request.OrgID = 123456;
request.SiteID = 123456;
request.SearchTerm = "Joe";
request.SearchType = SWS.SearchTypes.QuickSearch;
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.SearchBy(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.
SWS GetOrgList Method
Retrieves the Org identification data, based on the organizations the user has access to.
Parameters
Name | Data Type | Is Required |
---|---|---|
LookupUser | LookupUser | Required |
Description | This is the same LookupUser information used for other calls. This is all that is required for this method. |
Returned Parameters
Name | DataType |
---|---|
AddressLine1 | String |
Description | The first line of the address. |
AddressLine2 | String |
Description | The second line of the address. |
AppDisplayName | String |
Description | The name of the organization as it appears in Store. |
City | String |
Description | The city of the organization’s address. |
Country | String |
Description | The country of the organization’s address. |
String | |
Description | The organization’s email address. |
Fax | String |
Description | The fax number for the organization. |
OrgID | Long |
Description | The organization’s ID number. |
OrgName | String |
Description | The organization’s name. |
Phone | String |
Description | The organization’s phone number. |
PostalCode | String |
Description | The postal/ZIP code for the organization’s address. |
Primary | Boolean |
Description | Indicates if the organization is the user’s primary organization (“True”) or not (“False”). |
State | String |
Description | The state/province of the organization’s address. |
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. We’ll need the standard service object and a GetOrgList response object.
// Create a response object
SWS.WSSoapClient service = new SWS.WSSoapClient();
SWS.GetOrgList_Response response;
We can call the method and pass across the login object to get our org list. 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.GetOrgList(user_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.