Cannot delete CustomData in Inventory when impl IReadOnly

Hi

Im trying to use CustomData in Inventory, It forces me to impl IReadOnly.
I tried both IReadOnly and ObjectBase<T>

I think i impl those as expected but when trying to delete the inventory both in backoffice or via code I get Invocation Error, looking deeper it seams i cannot delete inventory because CustomData is readonly.

I tried with MakeWritableClone() on Inventory obj but that did not help. Then i stumble upon this: https://docs.litium.com/support/bugs/bug_details?id=46318 and CustomData object

Seems like a similar problem buth with pricelists. Currently I use the workaround in bug details by implementing IReadOnly interface and pretty much do:

bool IReadOnly.IsReadOnly => false;
object IReadOnly.MakeWritableClone() => this.MemberwiseClone();

And so far i can delete the created items in BO, or via Code without issues.

I have tried by using IReadOnly or ObjectBase<T> But the same issue appears when not using the workarround mentiond in the bug details.

In the end;

  • is this workarround dangerous in any way?
  • Is the fix for Pricelist also a fix for Inventory?
  • Is this working with ObjectBase class but I implemented it incorrectly?

Thanks in advance

Using: Litium 7.2.3

Yes, you may corrupt your in-memory cache and updates on the custom object may not be stored in database.

Yes, it is fixed for Inventory also.

It’s not working due to the https://docs.litium.com/support/bugs/bug_details?id=46318 bug, please upgrade to later version where the bug is fixed.

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