I recently got this requirement to create a custom object from Apex. Custom objects, fields, permissions, and all other configurations can be done using an Apex class.
This is a rare scenario which we might face when not using any IDE or Source Control as part of the Salesforce Development.
In order to Delete Apex Classes / Apex Triggers from Production directly using Workbench, Follow the steps from this post and complete your task efficiently.
Open Notepad
Copy the below text and save it as “package.xml” (All files). (Update the Version number accordingly)
This page has an error. You might just need to refresh it. AuraClientService.postProcess: error in processing [Maximum call stack size exceeded].
As per the document, it is recommended to use different names for the client side and server side methods/actions.
Use unique names for client-side and server-side actions in a component. A JavaScript function (client-side action) with the same name as a server-side action (Apex method) can lead to hard-to-debug issues.
So all you need to do here is, change your client-side controller’s method getAccountRecords to something like getAccountRecordsData.
The delete operation supports cascading deletions. If you delete a parent object, you delete its children automatically, as long as each child record can be deleted.
For example, deleting the account you created earlier (SFDC Account) will delete its related contact too. Execute this snippet in the Anonymous Apex window of the Developer Console.
Account[] queriedAccounts = [
SELECT Id
FROM Account
WHERE Name='SFDC Account'
];
delete queriedAccounts;
Check the accounts and contacts in your org. You’ll see that both the account and its related contact were deleted.