NewAdvertisement Method
Creates a new Advertisement using the default values.
Namespace: Microsoft.CommerceServer.Marketing
Assembly: Microsoft.CommerceServer.Marketing.CrossTierTypes (in Microsoft.CommerceServer.Marketing.CrossTierTypes.dll)
Syntax
'Declaration
Public Function NewAdvertisement ( _
parentCampaignId As Integer _
) As Advertisement
'Usage
Dim instance As CampaignItemManager
Dim parentCampaignId As Integer
Dim returnValue As Advertisement
returnValue = instance.NewAdvertisement(parentCampaignId)
public Advertisement NewAdvertisement(
int parentCampaignId
)
public:
Advertisement^ NewAdvertisement(
int parentCampaignId
)
public function NewAdvertisement(
parentCampaignId : int
) : Advertisement
Parameters
- parentCampaignId
Type: System..::.Int32
The Id of the parent Campaign object in which to create this CampaignItem. Some default values for the CampaignItem may be taken from the ancestors of the new CampaignItem (Customer and Campaign) in the hierarchy.
Return Value
Type: Microsoft.CommerceServer.Marketing..::.Advertisement
The newly created Advertisement object.
Exceptions
Exception | Condition |
---|---|
ArgumentOutOfRangeException | The parentCampaignId value was less than one. |
EntityDoesNotExistException | The Campaign specified by parentCampaignId does not exist. |
EntityStateException | The Campaign specified by parentCampaignId is deleted. |
Remarks
Returns the newly created Advertisement with default values. The Advertisement is not persisted in the database until its Save method is called.
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.