GetCampaignItem Method
Retrieves a CampaignItem, as identified by the CampaignItem's unique identifier.
Namespace: Microsoft.CommerceServer.Marketing
Assembly: Microsoft.CommerceServer.Marketing.CrossTierTypes (in Microsoft.CommerceServer.Marketing.CrossTierTypes.dll)
Syntax
'Declaration
Public Function GetCampaignItem ( _
campaignItemId As Integer _
) As CampaignItem
'Usage
Dim instance As CampaignItemManager
Dim campaignItemId As Integer
Dim returnValue As CampaignItem
returnValue = instance.GetCampaignItem(campaignItemId)
public CampaignItem GetCampaignItem(
int campaignItemId
)
public:
CampaignItem^ GetCampaignItem(
int campaignItemId
)
public function GetCampaignItem(
campaignItemId : int
) : CampaignItem
Parameters
- campaignItemId
Type: System..::.Int32
Id of the CampaignItem to retrieve. Must be greater than zero.
Return Value
Type: Microsoft.CommerceServer.Marketing..::.CampaignItem
The CampaignItem associated with the campaignItemId retrieved from the database.
Exceptions
Exception | Condition |
---|---|
ArgumentException | The record retrieved from the database does not represent a valid type of CampaignItem object. Currently only DiscountData objects are supported. |
ArgumentOutOfRangeException | The campaignItemId was less than one. |
EntityDoesNotExistException | The requested CampaignItem record does not exist. |
EntityStateException | The discount data that is associated with the CampaignItem with does not exist in the database. Or there are multiple discounts associated with this campaignItemId. |
DatabaseIntegrityException | The discount data associated with the CampaignItem Id does not exist in the database. Or there are multiple discounts associated with this CampaignItem Id. |
Remarks
Use this method to retrieve a specific CampaignItem object from the database.
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.