SWS2 GetAccountInfo
Retrieves all the contacts for an account using either the account ID or the contact ID.
Parameters
Name | Data Type | Is Required |
---|---|---|
AcctID | Long | Optional* |
Description | The account’s ID number. This is returned when you use the CreateNewAccount method or can be retrieved with the SearchBy method. * Either AcctID or ContactID are required. |
|
ContactID | Long | Optional* |
Description | The rental contact’s ID number. This is returned when using the CreateNewAccount or AddNewContact methods or you can search for it using the SearchBy method. * Either AcctID or ContactID are required. |
|
SiteID | Long | Required |
Description | The site’s ID number. This can be found using the GetSiteList method. |
Returned Parameters
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.
Name | Data Type |
---|---|
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. |
SITE_ID | Long |
Description | The site’s ID number. This can be found using the GetSiteList 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. |
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. |
ACCT_TYPE | String |
Description | Indicates the type of account, whether a company account or a customer account. |
ACCT_CLASS | String |
Description | Indicates if the account is a personal or business account class. |
CONTACT_ID | Long |
Description | The rental contact’s ID number. This is returned when using the CreateNewAccount or AddNewContact methods or you can search for it using the SearchBy method. |
FIRST_NAME | String |
Description | The first name of the primary contact. |
LAST_NAME | String |
Description | The last name of the primary contact. |
KNOWN_AS | String |
Description | The name by which the customer prefers to be called. |
ACTIVE | Boolean |
Description | Indicates if the account is active or not. |
CONTACT_TYPE | String |
Description | Indicates if the contact has full access or contact only status. |
CREATED_BY | Long |
Description | The user’s ID that created the account. |
UPDATED_BY | Long |
Description | The user’s ID that last updated the account. |
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 GetAccountInfo_Request request 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();
GetAccountInfo_Request request = new GetAccountInfo_Request();
As with every method we need to pass in credentials. We also set up the parameters for our request.
//Get Account Info setup
client.ChannelFactory.Credentials.UserName.UserName = "user";
client.ChannelFactory.Credentials.UserName.Password = "pass";
client.ChannelFactory.Credentials.SupportInteractive = true;
request.SiteID = 123456;
request.AcctID = 123456;
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
System.Data.DataTable resp;
resp = client.GetAccountInfo(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.