SWS UpdateAccount Method
Updates an account and returns a copy of the updated record.
Parameters
Name | DataType | Is Required |
---|---|---|
AcctClass | AccountClass | Optional |
Description | The class of the account. Available values:
|
|
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. | |
AcctName | String | Optional |
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. | |
AcctType | AccountType | Optional |
Description | The account type. Available values:
|
|
Cflex01 | String | Optional |
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 | Optional |
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 | Optional |
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 | Optional |
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 | Optional |
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. |
Returned Parameters
Name | DataType |
---|---|
ACCT_CLASS | Integer |
Description | The class of the account. Available values:
|
ACCT_DEMOG | Integer |
Description | The numeric value for the account demographic info. The account demographics can be customized by the organization. This parameter does not take advantage of the customization. |
ACCT_ID | Long |
Description | The account’s ID number. |
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. |
ACCT_TYPE | Integer |
Description | The account type. Available values:
|
ACT_BUSINESS_CONTACT | ACT_CONTACTS_DEC |
Description | A collection of contact data for all associated business contacts for the account. |
ACT_CONTACTS_DEC | ACT_CONTACTS_DEC |
Description | A collection of contact data for all associated contacts for the account. |
ACT_NON_BUSINESS_CONTACTS | ACT_CONTACTS_DEC |
Description | A collection of contact data for all associated non-business contacts for the account. |
ADDR_ID | Long |
Description | The address ID number for the contact’s address. |
APPL_ACCT_CFLEX_DATA | APPL_ACCT_CFLEX_DATA |
Description | A custom field, set up by the organization, designed to hold additional account level information. These are additional flex fields available beyond the normal account flex fields. These are viewed in the Store application, on the account information tab, by clicking the green circle with the white arrow. |
APPL_ORG_FLEX_FIELDS | APPL_ORG_FLEX_FIELDS |
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. |
CFLEX01 | String |
Description | A custom field, set up by the organization, designed to hold additional contact information. This is not displayed in the Store application. |
CFLEX02 | String |
Description | A custom field, set up by the organization, designed to hold additional contact information. This is not displayed in the Store application. |
CFLEX03 | String |
Description | A custom field, set up by the organization, designed to hold additional contact information. This is not displayed in the Store application. |
CFLEX04 | String |
Description | A custom field, set up by the organization, designed to hold additional contact information. This is not displayed in the Store application. |
CFLEX05 | s:string |
Description | A custom field, set up by the organization, designed to hold additional contact information. This is not displayed in the Store application. |
CREATED | DateTime |
Description | The date the account record was created. |
CREATED_BY | Long |
Description | The user’s ID that created the account record. |
ORG_ID | Long |
Description | The organization’s ID to which the account belongs. |
SITE_ID | Long |
Description | The site’s ID to which the account belongs. |
UPDATED | DateTime |
Description | The date the account record was last updated. |
UPDATED_BY | Long |
Description | The user’s ID that last updated the account record. |
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 UpdateAccount request object, and an UpdateAccount response object. We can define and create those like this:
// request and response objects
SWS.WSSoapClient service = new SWS.WSSoapClient();
SWS.UpdateAccount_Request request = new SWS.UpdateAccount_Request();
SWS.UpdateAccount_Response response;
Here is a sample code of the request object:
// request for address and cflex01 updates
request.AcctId = 123456;
request.AccountAddressID = 123456;
request.Cflex01 = "Some new data here.";
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.UpdateAccount(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.