Update Campaign pricelist with Litium Erp Connect

Hi,

Is it possible to update a campaign pricelist with Erp Connect?

When we send in a batch we get the following error, it seams like its trying to create a new pricelist:

Litium.Validations.ValidationException: Validation error for ProductPriceList(SystemId: 795b734e-e30e-4556-85f3-4035c8a99383, Id: campaign), Id: ‘Value is not unique.’.
at Litium.Validations.ValidationServiceExtensions.ThrowExceptionIfError[T](ValidationService service, T entity, ValidationMode validationMode)
at Litium.Application.Data.Batching.BatchDataImpl.Execute[T](T entity, ValidationMode validationMode)
at Litium.Application.Data.Batching.BatchDataImpl.Create[T](T entity)
at Litium.Application.Products.PriceListServiceImpl.Create[T](T priceListBase)
at Litium.Application.Products.PriceListServiceImpl.Create(ProductPriceList priceList)
at Litium.Connect.Application.Erp.Import.PriceImporter.CreatePriceList(PriceList importPriceList, Guid currencySystemId, ImportRecord importRecord)
at Litium.Connect.Application.Erp.Import.PriceImporter.ImportPriceList(ICollection`1 priceLists, ImportReport importReport, Boolean isProceedWithErrors)

“priceList”: [
{
“id”: “campaign”,
“active”: true,
“name”: “campaign”,
“startDate”: “2021-02-04T00:00:00+01:00”,
“endDate”: “2024-12-31T00:00:00+01:00”,
“currency”: “SEK”,
“priority”: 0,
“items”: [
{
“articleNumber”: “106915T”,
“price”: 9596,
“minimumQuantity”: null
}
],
“includeVat”: false
}
],

image

Litium version: 8.2.3

Hi, it is not possible. ErpConnects price list import is designed for only regular price lists.

So then we need to build some workaraound for this. How can we update the campaign pricelist from code?
Im thinking we import it as normal pricelist and then copy the prices to the campaign price list.

Found how to get the pricelist:
var list = pricelistService.Get< CampaignPriceList>(“campaignlist1”);
I guess the prices can be updated with the PriceListItemService?

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.