function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
James LoghryJames Loghry 

Archive Product2 from API

Hi All,


We have a client who needs the ability to delete a Product2 object in, with the ability of it showing up in an opportunity if it once existed there.


If the Product2 object is part of an opportunity when it is deleted via the UI in salesforce, it asks if you would like to archive the Product2.  Is there a way to accomplish this from the command line?


Another option would be to set the Product2 to isActive = false.  However, you can just 'Activate' the Product2 from the Products tab / view in Salesforce (The activate link on the tab ignores Validation rules, fyi).


Any ideas or help would be much appreciated.