Restore Method (Int32, Int32)
Restores a deleted CampaignItem and associates it with the specified Campaign record.
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 _
)
'Usage
Dim instance As CampaignItemManager
Dim campaignItemId As Integer
Dim newParentCampaignId As Integer
instance.Restore(campaignItemId, newParentCampaignId)
public void Restore(
int campaignItemId,
int newParentCampaignId
)
public:
void Restore(
int campaignItemId,
int newParentCampaignId
)
public function Restore(
campaignItemId : int,
newParentCampaignId : int
)
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.
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.