
Hello Everyone,
I want to be able to add multiple price list item to a product.
I have added a start date and end date fields to the Price list item Entity in order to be able to represent different pricing based of a specific period of time.
The problem that I am facing is that I am not able to create more than 1 product Price list Item related to the same product, price list and Unit.
when I save the Price list Item I received the following error:
Exception Message: A record with matching key values already exists. ErrorCode: -2147220937 HexErrorCode: 0x80040237 ErrorDetails: ApiExceptionSourceKey: Plugin/Microsoft.Crm.ObjectModel.CustomBusinessEntityService ApiStepKey: af3b8615-ecd8-db11-b397-0019b9204da9 ApiDepthKey: 1 ApiActivityIdKey: ebdca418-dc00-4c84-a32c-2175ea8f0399 ApiPluginSolutionNameKey: System ApiStepSolutionNameKey: System ApiExceptionCategory: ClientError ApiExceptionMessageName: DuplicateRecord ApiExceptionHttpStatusCode: 412 SqlExceptionMessage: Violation of UNIQUE KEY constraint 'AK1_ProductPriceLevelBase'. Cannot insert duplicate key in object 'dbo.ProductPriceLevelBase'. The duplicate key value is . HelpLink: http://go.microsoft.com/fwlink/?LinkID=398563&error=Microsoft.Crm.CrmException:80040237&client=platform Activity Id: 1dd9229f-48b6-4b05-b6a9-ff90b566d899
How can I create multiple product price list items which will relate to the same product, price list and Unit but will have
a different pricing value and start and end date and time?
Thanks
Hi,
Unfortunately, there is no way to achieve this. As your error message shows, it can only have one price list item related to a product in the same price list.
As a workaround, you can create multiple price lists with different start and end time. Then create the price list item related to the same product for each of price list.