The Stack Overflow podcast is back! Listen to an interview with our new CEO.

Questions tagged [delete]

The delete DML operation deletes one or more existing sObject records from your organization’s data.

Filter by
Sorted by
Tagged with
0
votes
0answers
17 views

How can I delete a single task or event using a Lightning component?

I created a Lightning component with a lightning:button. The expected behaviour is: when a user click that button, that Task or Event will be deleted and then he/she will redirect to another page. ...
0
votes
1answer
22 views

Mass delete code worked last week, but now doesn't

I've got to delete 5 million records and I'm trying to delete 900,000 records for each click, using batch Apex. The code works in sandbox and worked in the production org last Thursday, but is now ...
-1
votes
1answer
27 views

Code coverage for delete statement in batch class [duplicate]

How can I get increased coverage for this code? I get only 75% so far. Not able to cover the delete statement in the main class. Any help is greatly appreciated. Main Class: public void execute(...
0
votes
0answers
37 views

Is there a way to hard delete an Apex Trigger when there is no Apex Class?

I had a developer work on this before myself, so I'm working backwards. I've been able to get all the coding I needed for my org, however, now I have two Inactive Apex Triggers sitting in the Sandbox ...
-2
votes
2answers
41 views

Trying to prevent deletion of a Note with a before delete trigger. Below code is not working [closed]

Please find the below code: trigger DeleteNote on Note (before delete) { for(Note N : trigger.old){ if(Trigger.isDelete){ N.adderror('Note Cannot be deleted'); } ...
0
votes
1answer
60 views

How to Delete a Data Extension Folder

Sorry if this sounds like a silly question, but I can't figure out how to delete or rename a folder I created under Contact Builder -> Data Extensions. My folder is sitting under the root "Data ...
3
votes
1answer
64 views

Removing a row from a DE with Ampscript or SSJS in a landing page works, but the page shows an Internal Server Error (500)

I am using the below SSJS to remove a row from a data extension. <script runat="server" > Platform.Load("Core","1.1.1"); try { var ...
0
votes
1answer
20 views

Delete all records and all objects and all components from Developer Org

Is it possible to wipe out everything from your dev org? Everything includes all records (custom as well as standard), all components like classes, triggers, etc, all workflows, profiles and ...
0
votes
0answers
57 views

Deleting Lightning Component referenced in Community

I'm trying to clean up my sandbox org but when I attempt to delete a certain Lightning Component, I get the following error: This component is found in 0 Development Instance(s) and 1 Published ...
1
vote
1answer
43 views

How to remove fieldPermissions from Profile via metadata API

We manage to create new fieldPermissions by calling updateMetadata() and passing to it a Profile object with the new fieldPermissions. However, we haven't figured out a way to remove specific ...
1
vote
2answers
26 views

Delete orphaned one way lookup data

I have a set of records supplier__c which have a lookup to an address__c record. So I'd like to gather all those up: //Make a list of ID's of addresses on Suppliers : supadrs List<Id> supadrs ...
2
votes
0answers
17 views

What is a “pending connection” that might be preventing me from deleting a contact and account?

As I'm trying to do some cleanup in a customer's org, I face the following problem when deleting an account: Your attempt to delete Mr. Robert Jefferson could not be completed because it is ...
1
vote
1answer
16 views

Can the below code be Optimized and include the logic to check for related opportunityteammember records before updating checkbox to true?

Need help in Optimizing below code. Requirement is to update "opportunity shared" checkbox on "Opportunity" object whenever opportunity is un-shared. (Delete trigger on "Opportunityteammember" ...
1
vote
3answers
82 views

Add check of user profile to a trigger

I'm writing a simple trigger to prevent deletion of opportunities that are marked Receivable. (Code below.) Could you help me add a criteria to allow deletion if the user doing so is a sysadmin? I ...
2
votes
1answer
41 views

Error not bubbling up from delete trigger

I need to prevent deletion of our dummy account, which is part of the Lead conversion process under certain conditions. And it does prevent deletion. However, the error I am adding to the account ...
3
votes
2answers
319 views

Does contact deletion in marketing cloud also removes email tracking data?

I want to delete few contact in SFMC. I know how to delete contacts but just want to know if other related data like email open rates, email sends reports will remain in the system or not.
1
vote
2answers
160 views

Delete cron jobs instead of using abort

Currently I'm using the System.abortJob(job.Id); method to abort the execution of already scheduled cron jobs as per the following code: List<CronTrigger> cronjobList = [SELECT Id, ...
3
votes
0answers
26 views

How can I delete FileSearchActivity records?

I was looking through the list of tables in SoqlXplorer, as I do every so often (I find it a useful way to learn things), and I came across a table called FileSearchActivity. What is this table? It ...
0
votes
3answers
42 views

Trying to increase code coverage for a trigger that deletes events

So I'm trying to write a test class to meet code coverage requirements to push up this trigger: trigger DeleteEventsOnCancellation on Case (after update) { for(Case c : system.trigger.new){ ...
0
votes
0answers
22 views

What is best way to delete records all parents and childs in salesforce

I have a use case where i have to clean up of data. I want to delete around 1000 records out of 10,000 records. Is there any way i can delete A->all lookups and All Master, then all lookups-> all ...
1
vote
1answer
174 views

How to Delete AccountContactRelation Record with SOAP API Call?

We are planning to deepen out integration between Salesforce and a third-party tool. Within the tool we have multiple accounts related to one contact. To replicate the relations between these contacts ...
3
votes
0answers
173 views

INSUFFICIENT_ACCESS_OR_READONLY - Cannot Delete QuoteLineItem

17 QuoteLineItem records were loaded into the org via Dataloader with the incorrect product2id listed. When trying to delete the records in the GUI while logged in as a System Administrator, the ...
6
votes
2answers
95 views

Revoke access to delete a specific Account record type

I have this apex trigger that revokes access to users from deleting all Accounts. I was wondering how to improve it to ignore or allow certain record type. The use case is, I want to allow users to ...
1
vote
2answers
409 views

How prevent deletion in Event delete trigger and update a field instead

Our Salesforce users are deleting Events from Salesforce due to our integration with Outlook. When a Meeting from Outlook is deleted, we want the corresponding Event record in Salesforce to be not ...
1
vote
1answer
42 views

Possible to delete dependent classes

We remarked a little strange issue in APEX. It is possible to remove a class, which is called in another class. Has anyone had the same issue? Main class: public with sharing class MainClass { ...
0
votes
1answer
51 views

View and Delete Users List Views

We have recently removed the users rights to Edit/Create/Delete their own list view so that they will use the company shared list views. This unfortunately had people trying to stab us because we ...
0
votes
1answer
57 views

Give delete access to records of particular users without 'Modify All' using apex

I want to give delete access to some set of users in certain condition to some records. I don't want to do this using profiles/permission sets. I want to achieve this using apex. Could anyone please ...
1
vote
2answers
225 views

Does Database.SaveResult, Database.DeleteResult, etc. implement a public interface?

The various DML operations (insert, update, delete, etc.) all return results with very similar methods and properties. It is not uncommon, as a developer, that I should want to handle these results ...
0
votes
1answer
91 views

How do I delete a component from a managed package?

We created a managed package in our developer org and made it a released package. Afterwards, we decided to remove some custom fields from the managed package but saw no way of doing this in the org. ...
-1
votes
2answers
43 views

How to give custom object delete permission to all users in org?

The user can belong to any profile or role. In future, any new user created with a new profile or with a new role, he/she will get delete permission automatically. Please suggest a solution without ...
0
votes
2answers
401 views

DELETE a record by REST API without @HttpDelete

I need to make integration between Org1 and Org2. We created a callout POST. When we create an object in Org1, we also create an object in Org2. POST work. All is Ok. Now I need also delete an object ...
1
vote
2answers
239 views

UpsertData and DeleteData not working

I am using this AMPscript in a Landing Page, and it seems to prevent the page from displaying anything %%[ SET @SubscriberKey = QUERYPARAMETER('SubscriberKey') SET @Operation = '...
1
vote
1answer
42 views

What is “Field Based Page Assignment Criteria” in relation to a custom field?

I am attempting to delete a custom field from the Contact object and when I do, I get a message saying it cannot be deleted because it is referenced elsewhere on salesforce.com. The section listed is "...
5
votes
1answer
3k views

Is there some event to delete record from Lightning component like e.force:deleteRecord

There are a couple of events in Lightning to operate with records like e.force:createRecord or e.force:editRecord, but I did not find anything to remove record. https://developer.salesforce.com/docs/...
2
votes
2answers
354 views

Delete an SObject by knowing only Id

Is it possible to delete an SObject by knowing only Id? Here is what I found: Id del = '003S00000099999'; // whatever ID you are deleting Contact ct = new Contact(Id = del); delete ct; So, is it ...
0
votes
0answers
27 views

Delete an object specific action

How could I delete an object specific action? Here is a screenshot in which you can see that there is no such option as Delete, only Edit on the right of the action list item. I have a System ...
1
vote
1answer
2k views

How to delete a Trailhead Playground and Developer Edition?

Since it's not possible to delete a user but only deactivate them, I want to delete the entire Trailhead Playground and Developer Editions I don't use anymore in order to free some of the usernames I ...
0
votes
2answers
349 views

How Can I mass delete Account Records with a specific Record Type in Salesforce using Workbench?

I tried to delete Account Records using workbench and it gives me this error: Failed: InvalidBatch : Referenced file "request.txt" is missing or is a directory I am not able to understand how to ...
3
votes
1answer
535 views

Deleting Custom Objects

I have three connected Custom Object I'm trying to delete. When I attempt to delete them, I get the following message. 'Your attempt to delete .... could not be completed because it is associated ...
1
vote
2answers
317 views

Delete a record and hide it from pageBlockTable without filling the form

I want to have a "Delete" button for every record(row) displayed on my Visualforce page, but evry time I want to delete my records I have to fill my form with some values and then the record can be ...
1
vote
2answers
119 views

How to find Field Sets that are using a Custom Field?

I created a custom field in an object a long time ago and now I want to delete it, so I go to Setup > Object Manager > {OBJECT} > Fields and Relationships, and where the field is, I click the ...
0
votes
1answer
98 views

Can guest user delete custom object records?

I have a custom object which is having look up to Account and contact and few other custom objects. Can users with Guest user License delete such records. I have been trying to delete with an ...
4
votes
0answers
138 views

Deleted contact's ID is not removed from converted lead. Why?

We have a requirement to delete all converted leads whose corresponding contacts have been deleted. Upon implementation we noticed something odd: After creating and converting a lead via UI (classic ...
2
votes
2answers
606 views

INSUFFICIENT_ACCESS_OR_READONLY, when deleting OrderItems in Apex

I am currently working on a lightning quick action which will update OrderItems on demand from a specified quote. If an OrderItem has no corresponding QuoteLineItem, the line item will be deleted. ...
0
votes
0answers
70 views

Error in deleting a trigger in Production: Invalid type: Schema.sObject

Using destructive package in workbench, I am trying to delete a custom trigger (not Managed) from Production built on Managed package object "Question" and I am getting the error: Invalid type: ...
1
vote
2answers
34 views

I uninstalled a package but custom fields stayed?

I installed the PhotoLoader by GearDesign into my personal dev org and don't like it so I uninstalled it.. I'm still seeing remnants in certain places. The User object still has the fields it used and ...
0
votes
1answer
263 views

Limitations when using ALL ROWS in query

Good day everyone. I am trying to view all my events including the deleted records. My query looks like this. List<Event> allEvent = [SELECT CreatedDate,Description,DurationInMinutes,...
1
vote
3answers
1k views

Delete all Contacts - Export all Contacts

The problem: We want to reset our contact database ==> we have to delete all contacts. Unfortunately that does not work as intended with the relatively new deletion tool of salesforce. To achieve ...
0
votes
1answer
101 views

Mass Delete Data Extensions

Does anyone have a way to mass delete out thousands of data extensions. They are not all in the same folder but all follow the same naming convention.
2
votes
1answer
359 views

AccountHistory not deleting immediately after an update

As part of the GDPR compliance process, we are updating a few name fields in Account with a random text and then calling the AccountHistory delete function for the tracked field. We are running the ...