Restore Method (Int32, Int32, String)
Restores a deleted CampaignItem, associates it with the specified Campaign record, and gives it a new name.
Namespace: Microsoft.CommerceServer.Marketing
Assembly: Microsoft.CommerceServer.Marketing.CrossTierTypes (in Microsoft.CommerceServer.Marketing.CrossTierTypes.dll)
Syntax
'Declaration
Public Sub Restore ( _
campaignItemId As Integer, _
newParentCampaignId As Integer, _
newCampaignItemName As String _
)
'Usage
Dim instance As CampaignItemManager
Dim campaignItemId As Integer
Dim newParentCampaignId As Integer
Dim newCampaignItemName As String
instance.Restore(campaignItemId, newParentCampaignId, _
newCampaignItemName)
public void Restore(
int campaignItemId,
int newParentCampaignId,
string newCampaignItemName
)
public:
void Restore(
int campaignItemId,
int newParentCampaignId,
String^ newCampaignItemName
)
public function Restore(
campaignItemId : int,
newParentCampaignId : int,
newCampaignItemName : String
)
Parameters
- campaignItemId
Type: System..::.Int32
The Id of the CampaignItem to restore. Must be greater than zero.
- newParentCampaignId
Type: System..::.Int32
The Id of the Campaign record that the deleted CampaignItem record should be re-associated with. When a CampaignItem is deleted independently of its parent Campaign, it is no longer associated with any Campaign.
- newCampaignItemName
Type: System..::.String
If not nullNothingnullptra null reference (Nothing in Visual Basic), specifies a new name for the CampaignItem record. If a new CampaignItem record has been created with the same name as a deleted CampaignItem record, then the deleted record cannot be restored unless a new, unique, CampaignItem name is provided.
Exceptions
Exception | Condition |
---|---|
ArgumentOutOfRangeException | Either the campaignItemId or newParentCampaignId is less than or equal to zero. |
DuplicateEntityNameException | A CampaignItem with original or new name provided already exists. |
EntityDoesNotExistException | The campaignItemId refers to an entity that does not exist in the database. |
ParentEntityDoesNotExistException | The newParentCampaignId refers to an entity that does not exist in the database. |
ParentEntityDeletedException | The newParentCampaignId refers to an entity that has been deleted |
EntityStateException | The CampaignItem is not currently deleted. |
PropertyNullValidationException | The CampaignItem name provided is nullNothingnullptra null reference (Nothing in Visual Basic). |
StringLengthValidationException | The CampaignItem name provided is not within the range of valid lengths. |
Remarks
Deleting a CampaignItems does not actually remove the campaign item record from the database. These records are not permanently removed until the PurgeDeletedItems method is called to purge them from the database. This method allows you to restore the record before it is permanently deleted.
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.