Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [delete]

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

1
vote
3answers
23 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
32 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 ...
2
votes
2answers
72 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
51 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
25 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
35 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
19 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
65 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
100 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
79 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
284 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
26 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
30 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
28 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
118 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
28 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
36 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
234 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
158 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
37 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
1k 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
211 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
23 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 ...
0
votes
1answer
1k 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
193 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
289 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 ...
0
votes
0answers
14 views

Unable to trace what's causing field value deletions under custom child object

we are facing a severe issue which is causing deletion of field values automatically. We have a standard object Opportunity soon after closing this(ClosedWon) a new record is creating under it's ...
1
vote
2answers
205 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
84 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
69 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
99 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 ...
0
votes
0answers
237 views

Cannot delete Apex Class in Production Org

I am trying to clean up unused APEX classes, notably ones without test classes associated with them to increase our code coverage percentage. No matter what I have tried, I cannot delete Apex classes ...
2
votes
2answers
397 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
61 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
154 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
856 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
62 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
271 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 ...
0
votes
1answer
121 views

Unlike Item in Chatter API: “HTTP Method DELETE not allowed”

I'm trying to do an "unlike" on a chatter feed item through REST. I can't find the official documentation on how to do this, but per posts in different forums = we simply change the method to "DELETE"....
0
votes
1answer
50 views

Delete trigger does not invokes

trigger : if(Trigger.isDelete){ for(OrderLineItem__c ol: trigger.old){ List<OrderLineItem__c> order=[Select Id, Student_Roll_No__c,ShippingStatus__c,RewardPoints__c, ...
0
votes
3answers
714 views

Are deletes allowed for Big Objects

Can you tell if I am allowed to delete records of big objects? In workbench when I try to delete some records I get a compile error. database.deleteImmediate([SELECT Id FROM big__b]); COMPILE ERROR: ...
0
votes
2answers
2k views

In <force:recordData> not able to set it's recordId Attribute from client-side controller

Whenever I click on the <lightning:button> inside <aura:iteration>, I need to delete that particular record using <force:recordData> but When I click on <lightning:button>, ...
0
votes
1answer
36 views

Error catching when inserting multiple object types

We have a page inserting three different object types. Historically, it has attempted to insert one and, assuming no errors (try and catch), moved to the next. Until all objects were inserted. If ...
1
vote
1answer
115 views

Before Delete Trigger Recursive Error

I'm new to Apex and code... I have two objects that relate to each other with a before delete trigger on each. If object A is deleted, it's trigger will also delete object B. If Object B is deleted, ...
0
votes
1answer
85 views

Before Delete Test Class - Getting “De-reference Null Object error on other trigger”

I'm new to Apex and Code... A trigger from a managed package is causing my test class to fail. Here's the code for the trigger causing the error: trigger ...
0
votes
1answer
62 views

Before Delete Trigger, Need to Delete Linked Record, getting “De-reference Null Object” Error

I'm new to Apex and code. I have 2 objects that are linked to each other 1 to 1. There is a lookup to the other record on each record. I'm writing a trigger that, when record A is deleted, record B ...
0
votes
1answer
256 views

how to delete subscriber using SSJS in All Subscribers

We have written a script to delete mass subscribers from All Subscribers. The same script was working fine last month. But when we tried couple of days ago, its not working anymore. We also tried to ...
0
votes
1answer
62 views

Delete salesforce trigger

I want to delete apex trigger called RollupCertificationEmail.i install the IDE and make Inactive the the XML from the sandbox but when i tried it to deploy it on the production it is giving me this ...
0
votes
1answer
97 views

Remove Custom List button for only few users of a Profile

I have a Custom list button which needs to be hidden/removed for those users of a profile who do not have delete access. There are few users of the same profile who has delete access for that custom ...