saveCustomer
Saves changes made to a customer record and unlocks the record. Use editCustomer or editCustomerByRecordID to start the editing process.
A SOAP error envelope is returned if the operation fails. If the operation fails, use cancelSaveCustomer to unlock the record instead.
Parameters
Parameter | Type | Description |
---|---|---|
cookie | long | Session cookie returned by projectLogon. |
firstName | string | Customer’s first name. |
middleInitials | string | Customer’s middle initials. |
lastName | string | Customer’s last name. |
pCustomer | CUser | Edited customer to save. |
Return value
Value | Type | Notes |
---|---|---|
result | int | 0 indicates success. Check the return value in case of an error. |
Example
CUser cust = ttsdk.editCustomer(cookie, "Firstname", "", "Lastname");
try
{
cust.middleinitials = "M";
// The following line throws an exception if the operation fails.
ttsdk.saveCustomer(cookie, cust.firstname, cust.middleinitials, cust.lastname, cust);
}
catch (Exception e)
{
// The following operation unlocks the record.
ttsdk.cancelSaveCustomer(cookie, cust.recordid);
}