2

We are currently having almost 6 GB space occupied by Product Item Transaction object. We want to Delete All Product Item Transaction records except for current and last Year. The object is not visible in Data Loader when trying Delete the records. Also, I have tried to use below sample code to delete Product Item Transaction records.

ProductItemTransaction[] item= [Select Id from ProductItemTransaction limit 1];
delete item;

When I tried to execute above code in anonymous then getting an error

DML Operation Delete is not allowed on ProductItemTransaction.

I have also looked at documentation, It seems there's no delete() for this object.

https://developer.salesforce.com/docs/atlas.en-us.field_service_dev.meta/field_service_dev/sforce_api_objects_productitemtransaction.htm

Now the question is how to clean space for ProductItemTransaction records?

1
  • 1
    Deleting the "owning" object (ProductItem in your case) might work. Exercise extreme caution when attempting this.
    – identigral
    Commented Jan 7, 2022 at 17:05

2 Answers 2

0

You cannot be delete Product Item Transaction records because product item transactions are auto-generated records that help you track when a product item is replenished, consumed, or adjusted. These records are only deleted if product item records are deleted but as mentioned by user @identigral, You need to be careful before deleting Product Item.

Please find the reference article:

https://developer.salesforce.com/docs/atlas.en-us.api.meta/api/sforce_api_objects_productitemtransaction.htm

https://help.salesforce.com/s/articleView?id=sf.fs_parts_fields.htm&type=5

0

As per the documentation below is the way.

Special Access Rules

  • Field Service must be enabled.
  • Only users with Modify All Data or Modify All Records permissions can delete this object.

Reference : https://developer.salesforce.com/docs/atlas.en-us.field_service_dev.meta/field_service_dev/sforce_api_objects_productitemtransaction.htm

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .