SaveCustomer Method
Insert a new Customer (if the identifier is zero), or updates an existing Customer (if the identifier is not zero).
Namespace: Microsoft.CommerceServer.Marketing.WebService
Assembly: Microsoft.CommerceServer.Marketing.DataManagement (in Microsoft.CommerceServer.Marketing.DataManagement.dll)
Syntax
'Declaration
<WebMethodAttribute> _
Public Overridable Function SaveCustomer ( _
customer As CustomerData, _
forceOverwrite As Boolean _
) As CustomerData
'Usage
Dim instance As MarketingWebService
Dim customer As CustomerData
Dim forceOverwrite As Boolean
Dim returnValue As CustomerData
returnValue = instance.SaveCustomer(customer, _
forceOverwrite)
[WebMethodAttribute]
public virtual CustomerData SaveCustomer(
CustomerData customer,
bool forceOverwrite
)
[WebMethodAttribute]
public:
virtual CustomerData^ SaveCustomer(
CustomerData^ customer,
bool forceOverwrite
)
public function SaveCustomer(
customer : CustomerData,
forceOverwrite : boolean
) : CustomerData
Parameters
- customer
Type: CustomerData
The customer data to be saved (set to zero for an insert).
- forceOverwrite
Type: System..::.Boolean
true to indicate that existing settings should be overwritten even if they are more recent; otherwise false.
Return Value
Type: CustomerData
A CustomerData with the specified Campaign.
Exceptions
Exception | Condition |
---|---|
NotAuthorizedException | The user is not authorized to perform the requested operation. |
ArgumentOutOfRangeException | customer is less than zero. |
ArgumentNullException | An input argument or one of the required properties is nullNothingnullptra null reference (Nothing in Visual Basic). |
StringLengthValidationException | One if the property values is too long or too short. |
DuplicateEntityNameException | An entity with this name already exists. |
DuplicateEntityIdException | An entity with this customer already exists. |
EntityDoesNotExistException | No customer exists with this customer, or one of the entities that this one depends on does not exist. |
OptimisticLockException | The entity has been modified since the last time this user accessed it. It should be reloaded and the operation should be retried. |
DatabaseIntegrityException | A serious integrity issue with the database exists. |
Remarks
Saves the specified Customer object to the database. Inserts a new Customer (if the identifier is zero), or updates an existing Customer (if the identifier is not zero).
Use forceOverwrite to prevent overwriting the object in the database.
The forceOverwrite controls optimistic locking behavior. If the value is false and the record was modified in the database after it was loaded for editing, then an exception is raised.
Permissions
- Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see Using Libraries from Partially Trusted Code.