Is there a way to override [PXCopyPasteHiddenFields] on a built in view in Acumatica?

22 Views Asked by At

We use copy/paste all the time when creating new items and have noticed that since upgrading from

2022 R2 Build 22.208.0012

to 2023 R2 Build 23.208.0026

when copying/pasting a stock item the Last Cost value is no longer included.

I believe the issue is that in the StockItemMaint.cs file, Acumatica has declared the VIEW to NOT to copy the LastCost field like below:

[PXCopyPasteHiddenFields(typeof(INItemCost.lastCost)]
    public
      SelectFrom<INItemCost>.
      Where<INItemCost.inventoryID.IsEqual<InventoryItem.inventoryID.FromCurrent>.
        And<INItemCost.curyID.IsEqual<AccessInfo.baseCuryID.FromCurrent>>>.
      View ItemCosts;

Is there any way to override this to allow the LastCost to be copied/pasted?

I have tried putting the following into an extension to InventoryItemMaint:

    public
      SelectFrom<INItemCost>.
      Where<INItemCost.inventoryID.IsEqual<InventoryItem.inventoryID.FromCurrent>.
        And<INItemCost.curyID.IsEqual<AccessInfo.baseCuryID.FromCurrent>>>.
      View ItemCosts;

and the following in case it just needed an empty set of fields to hide.

[PXCopyPasteHiddenFields()]
    public
      SelectFrom<INItemCost>.
      Where<INItemCost.inventoryID.IsEqual<InventoryItem.inventoryID.FromCurrent>.
        And<INItemCost.curyID.IsEqual<AccessInfo.baseCuryID.FromCurrent>>>.
      View ItemCosts;

In both cases Copying and Pasting an item with a last cost resulted in the last cost staying as 0.

Any help would be very gratefully received.

Phil

0

There are 0 best solutions below