The Lighting Component Campaign Items Related List has a couple of default settings defined which a technical administrator can change according to the following documentation.
...
Replace "Name" with any field API you like to default the sorting to.
Feature Name | Feature Setting Name | default value |
---|
CampaignItemRelatedList | SortByField | Code Block |
---|
{"Field":["ADvendio__SortOrder__c"],"Order":"asc"} |
|
Default Columns
Additionally, you can define individual columns for the component. Create new feature setting records in the following way:
Feature Name | Feature Setting Name | default value |
---|
CampaignItemRelatedList | TableFields | Code Block |
---|
{
"TableFields":[
"Name",
"ADvendio__Period__c",
"ADvendio__Quantity__c",
"ADvendio__Sales_Price__c",
"ADvendio__Billing_category__c",
"ADvendio__Amount_net3__c",
"ADvendio__Available__c",
"ADvendio__PositionNumber__c",
"ADvendio__PositionNumberAppendix__c"
]
} |
|
This entry in JSON format as an array is used to define what fields from the CampaignItem object can be shown into the ResultTable. List API names of Campaign Item fields only.
...
on your visual force page please create a feature setting with the following values:
Feature Name | Feature Setting Name | Default Filter Value |
---|
CampaignItemRelatedList | FilterButtons | Code Block |
---|
{
"Buttons":[
{
"title":"Don't Show Cancelled Item",
" |
|
label"Don't Show Cancelled Item"DontShowCanceled",
"namespaceLabel":"ADvendio",
"filter":"ADvendio__ConnectedItem__c = null",
"variant":"neutral",
"isActive":"false"
},
{
"title":"Don't Show Optimized Item",
" |
|
label"Don't Show Optimized Item"DontShowOptimized",
"namespaceLabel":"ADvendio",
"filter":"ADvendio__OptimizationExclusion__c = null",
"variant":"neutral",
"isActive":"true"
}
]
} |
|
This entry in JSON format as an array of map objects is used to define the custom filter buttons, where we can define the
title: sets the text for the mouse over
label: is shown on the button and
customLabel: allows you to connect the button to a custom label to show different translations depending on your language
define the filter values. You can add multiple using brackets.
...
To modify the action buttons on the component create or edit the following feature setting:
Feature Name | Feature Setting Name |
---|
Default Filter ValueFeature Setting Name |
---|
CampaignItemRelatedList | ActionButtons | Code Block |
---|
{
"Buttons":[
{
"title":"Add Items",
" |
|
label"Add Items"AddItemsOptimizerButton",
"namespaceLabel":"ADvendio",
"action":"/apex/ADvendio__SelectSearch?Id=$mcId$",
"type":"vf"
},
{
"title":"Edit Items",
" |
|
labelEdit ItemsEditItemsOptimizerButton",
"namespaceLabel":"ADvendio",
"action":"/apex/ADvendio__MediaConfiguration?id=$mcId$&selected=$recordIds$",
"type":"vf"
},
{
"title":" |
|
OptimizelabelOptimize Itemsaction/apex/__NavigateToOptimizer?id=$mcId$&selected=$recordIds$"type"componentDefinition":{
"componentDef":" |
|
vfADvendio:campaignBuilderWrapper",
|
|
}, {titleDelete ItemslabelDelete Itemsaction/apex/ADvendio__DeleteCampaignItems?id=$mcId$&selectedIds=$recordIds$"$recordIds$"
}
},
"type":" |
|
vfSortlabelSort ItemsOptimizeItems",
"namespaceLabel":"ADvendio",
"action":"/apex/ADvendio__ |
|
SortCampaignItemsIdid=$mcId$&selected=$recordIds$",
"type":"vf"
},
{
"title":" |
|
ShowRecommendationslabel"Show Recommendations"DeleteItems",
"namespaceLabel":"ADvendio",
"action":"/apex/ADvendio__ |
|
ProductRecommDeleteCampaignItems?id=$mcId$&selectedIds=$recordIds$",
"type":"vf"
},
{
"title":" |
|
CheckAvailabilitylabel"Check Availability"SortCampaignItems",
"namespaceLabel":"ADvendio",
"action":"/apex/ADvendio__ |
|
CheckAvailabilityCiid&selectedIds=$recordIds$",
"type":"vf"
},
{
"title":" |
|
Submitto AdServerlabel"Submit to AdServer"CheckAvailability",
"namespaceLabel":"ADvendio",
"action":"/apex/ADvendio__ |
|
SubmitToAdServerCheckAvailabilityCi?id=$mcId$&selectedIds=$recordIds$",
"type":"vf"
},
{
"title":" |
|
CreativeUploadlabel"Creative Upload"SubmitToAdServer",
"namespaceLabel":"ADvendio",
"action":"/apex/ADvendio__ |
|
CreativeUploadCiSubmitToAdServer?id=$mcId$&selectedIds=$recordIds$",
"type":"vf"
},
{
"title":"Update Ad-Status in AdServer",
" |
|
label"Update Ad-Status in AdServer"UpdateAdServerStatus",
"namespaceLabel":"ADvendio",
"action":"/apex/ADvendio__UpdateAdServerAdStatus?id=$mcId$&selectedIds=$recordIds$",
"type":"vf"
},
{
"title":"Get Delivered Clicks/Impressions",
" |
|
labelGet Delivered Clicks/ImpressionsDeliveredClicksImpressions",
"namespaceLabel":"ADvendio",
"action":"/apex/ADvendio__DeliveredClicksAndImpressionsImport?id=$mcId$&selectedIds=$recordIds$",
"type":"vf"
}
]
} |
|
This entry in JSON format as an array of map objects is used to define the default action buttons, where we can define the
The parameters must be defined as $mcid$ for the Media Campaign Id value and $recordIds$ for the selected items to use according the button choice. Currently ADvendio offers 12 buttons the same as the Salesforce Campaign Item default feature.
Create Custom Button for a Visualforce Page or LWC
To add a button to a Visualforce page, follow these steps:
For Visualforce Pages:
Create your Visualforce Page with an Apex Controller and add it to the Feature Setting as described below. Replace “vfExamplePage“ with the name you applied for the page:
Add Button to Campaign Items:
Go to Feature Setting (ActionButtons → CampaignItemRelatedList) and edit it.
Add the value below: You can change “title” and “label” based on your needs:
Code Block |
---|
{
"title": "Example Page",
"label": "Example VF",
"action": "/apex/vfExamplePage?hello=$recordIds$",
"type": "vf"
} |
Create your LWC and add it to the Feature Setting as described below. Replace “lwcExample“ with the name you applied for the page:
Add Button to Campaign Items:
Info |
---|
For both versions you must add the parameters defined as $mcid$ for the Media Campaign Id value and $recordIds$ for the selected items to use according the button choice. Keep in mind that when $recordIds$ has multiple values, this values will be comma separated. As for $smallView$ and $counter$, those are optional parameters. $smallView$ is a boolean that returns true if the CIRL was in small view when clicking an action button, and false otherwise $counter$ returns an integer with the amount of rows selected
|
Now, the button should appear on the Campaign Items related list.
Image Added