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
1 answer
38 views

Delete every sObject record assigned to a user without specifying sObject

As far as I know this is not possible but, is there a way we can delete all records related to a User (without specifying its sObject) from Apex?
user avatar
  • 771
0 votes
0 answers
12 views

Trigger mocking Role-up Summary works for Insert and Update, but not for Delete and Undelete

This trigger to mock Role-up Summary as sum of related field values - works for Insert and Update, but does not work for Delete and Undelete: trigger mockLookup on More_Details_on_the_account__c (...
user avatar
1 vote
1 answer
21 views

Delete ContactKey associated to device Id Mobile Push when contactkey is not the contackey that I want to use

I have a mobile app with an android SDK to be able to send push notifications from the Marketing Cloud. Each user who installs and registers in the app must receive a specific ContactKey determined by ...
user avatar
  • 13
0 votes
0 answers
22 views

Salesforce fields recover options

New here, thanks for your help. I have salesforce cloud enterprise. We had a third party trying to setup their software for scheduling and it was done in the live environment not our sandbox. Issue is ...
user avatar
0 votes
0 answers
86 views

SFDMU - Deleting 30 Millions records

I deleted 30M records with SFDMU. The only issue I faced was that I have to update the Json file for every 900,000 records and re-trigger the job using sfdx sfdmu:run --targetusername Production. By ...
user avatar
0 votes
0 answers
32 views

Contact delete in Marketing cloud- Which account id we have to use if we have multiple business units in payload

Need a clarification in contact delete by lust reference. We have a parent BU (business unit) at the top of the tree, and one of the other BUs is TEST. In TEST we have created an Installed Package ...
user avatar
  • 1
0 votes
1 answer
177 views

Delete records of other users with OWD as Public Read/Write

I have a custom object "Position" and the OWD setting is set as Public Read/Write. On the Custom profile I have given Read, Create, Edit & Delete permission to the Position Object When I ...
user avatar
  • 103
0 votes
0 answers
32 views

Sorting all objects by relationship

I'm trying to sort a list of objects that need to be removed. At the input I have a list of objects. First of all, I will find out what the relationships of each of these objects are. Then I try to ...
user avatar
0 votes
1 answer
29 views

Delete a file from a related list by non-owner

I have a record with a file in a related list. I want to allow a non-owner to delete that file. Since you can't add a custom button to that list and non-owners can't delete a file how can this be ...
user avatar
0 votes
1 answer
61 views

How do I correctly implement the 'isDelete' method?

This is the code I am trying to use. I will also add that in the parameters of the trigger, I have added the 'before delete' and 'after delete' at the top of the trigger. And I am getting the ...
user avatar
3 votes
1 answer
58 views

How to clean Product Item Transaction from Storage

We are currently having almost 6 GB space occupied by Product Item Transaction object. We want to Delete All Product Item Transaction records except for current and last Year. The object is not ...
user avatar
  • 67
0 votes
1 answer
142 views

redirect relatedlist button back to relatedlist view after the flow is completed

Premise: I have to delete the records of a custom object(custObj__c) from Opportunity's related list (there's a master-detail relationship between custObj__c and opportunity). Only "selected"...
user avatar
  • 405
0 votes
1 answer
26 views

Delete custom field for custom object from deleted fields without erasing one by one

When I delete custom fields of an custom object, the deleted custom fields goes to Deleted Fields, I need to empty this Deleted Fields I have about 500 fields I need to delete them once from Deleted ...
user avatar
  • 1
0 votes
0 answers
90 views

User not able to delete an Opportunity Member from Opportunity Team in the related tab of an Opportunity

I have a custom field that links a user to the Opportunity and automatically adds that user to the Opportunity Team, with the role specified in the custom field. If the Opportunity Owner adds or ...
user avatar
0 votes
1 answer
21 views

mass delete names from opp

I have a custom field on an opportunity record called Team Member. If Team Member contains one of the names below, then I must delete the name. Is dataloader the best way to do this? or is there ...
user avatar
  • 79
0 votes
1 answer
74 views

Can we delete list which contains different SObjects with one DML statement?

I have List which can contains Accounts and Contacts ; Can we delete the list using just ? List<SObject> testList; delete testList; Can we delete list which contains different SObjects with ...
user avatar
2 votes
1 answer
451 views

Flow component : Delete Records

I have a Screen Flow. There is one Screen Element containing a Lightning Web Component which is based on the standard lightning-datatable component, which allows the user to edit a set of records. ...
user avatar
  • 611
8 votes
1 answer
335 views

Deleting (or Renaming) Custom Metadata Object / Custom Object yields Insufficient Privileges

I have a non-managed package Custom Metadata object in my developer sandbox org Foo__mdt I am the system admin When I try to delete this object from Setup, it fails with Insufficient Privileges If ...
user avatar
  • 61.4k
0 votes
1 answer
219 views

Postman Bulk API 2.0 Delete: Error "The 'delete' batch must contain only ids"

trying to test Bulk API delete functionality in Postman desktop. I created a Job like so { "object": "et4ae5__IndividualEmailResult__c", "operation": "delete&...
user avatar
  • 191
1 vote
1 answer
63 views

How to create an Object-agnostic flow which automatically determines the object and deletes a record?

I want to build a screen-flow which runs a Delete action on a record in system mode (ignores user permissions). I want to implement this same screen flow on multiple objects (~10 in total). I would ...
user avatar
  • 385
0 votes
2 answers
46 views

Not able to Delete or Activate Approval Process

For some strange reason, I am not able delete or activate Approval process. Proof : https://imgur.com/a/FVtOhW6 If someone can help me understand why that will be great
user avatar
  • 1,051
0 votes
1 answer
55 views

Delete old files in Salesforce - Apex class don't work

Hi I am trying to create an apex class which I could use to regulary delete old files in Salesforce. global class DeleteOldContentDocument implements Schedulable { global void execute(...
user avatar
0 votes
1 answer
65 views

Can I delete a custom field and a custom object manually in the production org?

I know that some options that are in the sandbox might not be in production. I'll have to delete a Custom Field and a Custom Object in production org. I need to know if it's possible to do manually ...
user avatar
  • 123
1 vote
1 answer
135 views

Deleting contacts in data extension - Automation Studio

I was wondering if anyone has had any experience in using Automation Studio to delete contacts in a DE? Or, know of a better way? Essentially what I'm looking to do, is collect data using a Cloud Page ...
user avatar
  • 19
0 votes
1 answer
266 views

INSUFFICIENT_ACCESS_OR_READONLY Error on Order Items deletion, even though I am System Administrator

Even though I have a System Administrator profile assigned to me, and have the CRUD permissions on the Order Line Item Object, I am receiving the below error when I try to delete the Order Item ...
user avatar
0 votes
0 answers
118 views

Update in Before Delete Trigger instead of deleting them shows strange behavior

I am working on a use case in which I have to update records instead of deleting them when deleting them. As per my understanding, we cannot achieve this easily without undeleting the same records. ...
user avatar
-2 votes
3 answers
75 views

How can I clear the database entries for a specific object? [duplicate]

I added a custom object and some fields. I also added several entries to the database for this object. Can I delete certain entries or all of them at once that relate to my object in some predefined ...
user avatar
0 votes
2 answers
105 views

Why is SOQL query is returning deleted Opportunity split record

I have an Opportunity, under which I had initially added two Opportunity split records. But later I deleted one of the Split records among them using the delete button in the UI, as I didn't need it ...
user avatar
0 votes
1 answer
102 views

Prevent deletion and update the records - Trigger

I have a need to kind of customize the deletion of a custom object. The deletion need to update a checkBox to true instead of really delete the record. For that I tried many things using trigger ...
user avatar
  • 423
0 votes
0 answers
299 views

Triggers on the Files Object

I have a trigger on the ContentDocument when all the files associated with the Parent record is deleted it should uncheck the check box field (Files_Exists__c) on Parent saying no files exists not. ...
user avatar
  • 599
0 votes
1 answer
213 views

Removing metadata in a DX unlocked package using --upgradetype Delete is not working

we have an unlocked package (mypkg) that has a folder with some metadata no longer in use by the org and we just want to remove it. Here are my steps: I went to 'mypg' installed package detail in the ...
user avatar
  • 461
1 vote
0 answers
32 views

Delete file from SFTP with dynamic name

We have following use case: We will have bunch of invoices sent to SFMC SFTP, which will be attached to emails and send to customers. Each invoice name is unique, e.g. {{customerID}}_{{invoiceNr}}_Day....
user avatar
0 votes
0 answers
23 views

Why test class not covering the execute Database.batchable where I am deleting the list returned from the query locator? [duplicate]

global with sharing class JunkQueueBatchJob implements Database.Batchable<sObject> { global Database.QueryLocator start(Database.BatchableContext BC) { String query = 'select ...
user avatar
  • 21
1 vote
1 answer
2k views

Can't delete flow version because it's referenced by deleted flow interviews

I'm trying to delete a flow version and I'm getting below error This flow version is referenced elsewhere in salesforce.com. Remove the usage and try again. Flow Interview and when trying to access ...
user avatar
0 votes
1 answer
353 views

Cannot remove global picklist after deletion picklist

I am trying to delete a global picklist but this references a deleted picklist. How do I resolve this?
user avatar
  • 2,068
0 votes
1 answer
341 views

You can’t delete this record choice set yet. Remove all references to the record choice set, and try again

You can’t delete this record choice set yet. Remove all references to the record choice set, and try again. I am trying to delete Account from the screen flow: No matter what I tried it does not let ...
user avatar
  • 45
0 votes
2 answers
159 views

Deletion of records who created it

For example am the owner of the record then only i should be able to delete the record, And i should not be able to delete records created by others.I cant give ModifyAll permission to that profile as ...
user avatar
0 votes
1 answer
319 views

How to delete custom fields from Big Object?

How do I delete non-indexed custom fields on a Big Object ? I do not see a 'delete' option next to 'edit' option of a field.
user avatar
  • 25
0 votes
1 answer
242 views

Is it possible to delete a managed package completely from packaging org?

I have created a managed package that has 5 versions and now want to delete it entirely from this org. Is it possible? The package is not installed in any other org. The deprecate option appears for ...
user avatar
0 votes
1 answer
104 views

Access parent object field in before delete trigger using SOQL?

We have a before delete trigger on QuoteLineItem and are trying to access one of Quote's fields using soql query on the quote line item with help of the id, but we are not able to get the field from ...
user avatar
  • 125
3 votes
1 answer
833 views

Easy way to tell which objects will utilize IsDeleted flag?

It seems most objects, when deleted, will get their record updated with IsDeleted = true while they stay in the recycle bin until they're purged. However, we have found some objects just get ...
user avatar
2 votes
1 answer
113 views

How can you delete a PlatformEventChannelMember record via the REST api?

I am trying to configure Change Data Capture for the ChangeEvents channel via the REST API as you can in Setup Change Data Capture when using the Salesforce UI. I am able to add records of ...
user avatar
0 votes
3 answers
144 views

I want to delete last letters of existing Contacts using Batch class. Is it possible? I want to delete all "sfdcpoint" letters

global class BatchApexExample implements Database.Batchable<sObject> { global Database.QueryLocator start(Database.BatchableContext BC) { // collect the batches of records or objects ...
user avatar
0 votes
1 answer
410 views

Delete a row in Lighting Component Table

I am getting started with Lighting Components and build my own first tabe. I am displaying all quotedocuments from all quotes on the opportunity level so that our sales sees all documents in one table ...
user avatar
0 votes
0 answers
354 views

Delete trigger is not firing

Below is the trigger on ContentVersion object. Namely, there is a custom object, Art Inventory, that can have a file (i.e. pics of art) associated with its record. So I am updating a field in the ...
user avatar
3 votes
1 answer
1k views

Error: Cascade dereferencing too many records

Let me briefly describe data model to provide more clarity over the target error. There are 3 objects: X, Y, and Z. Z is related to Y via master-detail relationship. Z is related to X via lookup ...
user avatar
0 votes
2 answers
319 views

How can I call all Cases using SOQL query to mass delete all my Case's?

This is my code to mass delete my Cases: List<Case> caseList=[Select CaseNumber From Case]; for(Case cases : caseList); delete caseList;
user avatar
0 votes
0 answers
66 views

Automatically Deleting Test Lead records created by Ghost Inspector on Salesforce

We have deployed ghost inspector to automatically create leads to check for website downtime. The leads are created with a random email address that begins with "ghostinspector+XXXXX@gmail.com&...
user avatar
0 votes
1 answer
559 views

How to delete a ContentDocumentLink

I wan't to create a ContentDocumentLink and delete him in an other function, i tried this code: // function of creation: ContentDocumentLink cdl = new ContentDocumentLink( ContentDocumentId = doc....
user avatar
  • 13
4 votes
3 answers
939 views

Mass delete Debug logs using Salesforce DX

In my developer sandbox the Apex logs count has exceeded beyond its limit and there are more than 1 lakh records created in it. I want to mass delete them, but not able to do so. I am using the ...
user avatar

1
2 3 4 5 6