Tuesday 11 September 2018

The inventory unit for item cannot be changed because activated cost prices exist. The cost prices can only be deleted by deleting the item.

Getting the below error while trying to add the inventory unit.

Error:
The inventory unit for item cannot be changed because activated coset prices exist. The cost prices can only be deleted by deleting the item.

Reason:
Item price was posted for the item. That's the reason AX is not allowing to modify the item.

Solution:
In my case I deleted the item and recreated it again.

Tuesday 4 September 2018

Cannot create a record in Price history(MCRPriceHistory). Price/discount type: Item price, The record already exists.

I got the below error while trying to upload/creating the sales orders.

Cannot create a record in Price history(MCRPriceHistory). Price/discount type: Item price,
The record already exists.


Solution:

Change the Next number for the price/discount in number sequence.
In my case the next number was 1066 and I changed it to 1067

To find the number sequence.
Accounts receivable > accounts receivable parameters > Number sequence > price/discount journal number.

Adding a newline into a string in C# and X++

Below is the sample code we can use for  adding a newline after every occurrence of "@" symbol in the string in C#   using System...