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
DEv NolanDEv Nolan 

Does anyone know how to delete a Rollup field with APEX, switch a different Object’s field To Lookup from Master Detail, delete a record, switch that field back to Master-Detail, then create a Rollup Field ?

Title^

 

AnudeepAnudeep (Salesforce Developers) 
As far as I know, you can delete it through Metadata API

As per the documentation, When you delete a roll-up summary field using Metadata API, the field isn't saved in the Recycle Bin. The field is purged even if you don’t set the purgeOnDelete deployment option to true.

Another way is to delete it using UI. You would see the options posted here

Definitely not possible to switch the relationship using apex