Questions tagged [delete]
The delete DML operation deletes one or more existing sObject records from your organization’s data.
230
questions
0
votes
1answer
20 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.
0
votes
1answer
38 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 ...
0
votes
1answer
37 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 ...
0
votes
0answers
28 views
Deletes rows in a data extension Error SSJS
Can someone please help me? I want to delete data from Data Extensions, and I tried different variations. But unfortunately, it didn't work.
For info I have so far used variant 1 without any problems. ...
3
votes
1answer
65 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 ...
2
votes
0answers
24 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 ...
0
votes
3answers
38 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 ...
0
votes
1answer
25 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 ...
0
votes
0answers
37 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 ...
3
votes
1answer
106 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 ...
0
votes
2answers
29 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;
0
votes
0answers
26 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&...
0
votes
1answer
28 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....
3
votes
2answers
130 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 ...
0
votes
0answers
12 views
duplicate value found: <unknown> duplicates value on record with id: <unknown> Error when deleting a record
Have you experienced receiving this error when deleting a record? I googled but mostly of the related issue is during upsert or deployment. I disabled the duplicate rules, process builders, and no ...
0
votes
1answer
32 views
ERROR: must implement the method: System.Iterable<SObject> Database.Batchable<>.start(Database.BatchableContext)
global Class Batchsample implements Database.Batchable<Attendance__c>{
global Database.QueryLocator start(Database.BatchableContext BC){
String Query = 'select id,Login_Date_c,...
0
votes
0answers
37 views
Unable to delete a contact from Salesforce
I have a user with custom profile and has access almost similar to System Admin. So when that user is trying to delete a contact, the following error is displayed on the screen
Your attempt to delete ...
0
votes
0answers
61 views
How to truncate Big Objects?
I have a Big Object where the index is built as String, String, Datetime.
I'm now faced with truncating records so I don't create more records than my current limit, 1 million without additional ...
0
votes
1answer
23 views
I am trying to delete an object in my trailhead playground to re take a lesson and get the following errors
Is there way to delete an object like a delete cascade approach. thx
Reason Section
This custom object is used by another feature. Remove the usage and try again. Apex Class
This custom object is ...
0
votes
1answer
140 views
Can't access MasterRecordId field when merging Cases
SUMMARY:
I am currently implementing Merge Cases functionality and need to be able to edit fields on the losing and winning record during this process. Looking at the documentation depending on ...
0
votes
0answers
97 views
addError() method behavior on FeedItem trigger
I've written a basic trigger on FeedItem, which restricts users not to delete their chatter posts (simplified to clarify my question).
trigger beforeDeleteFeed on FeedItem (before delete) {
...
0
votes
1answer
15 views
Problem with IN Clause in soql
Hi everyone I'm having a problem with a query over campaignmember object, Im trying to use In clause to filter by id , but it retrieves nothing, crazy thing is that the list actually has an id, and it ...
1
vote
1answer
64 views
How to remove Salesforce CRUD Delete Security Risk?
When I scanned my app yesterday, and it raised a bunch of CRUD Delete security issue. So, I added isDeletable() check to all the delete query, and scanned it again. Still, it showed the same security ...
0
votes
0answers
25 views
Create select all checkbox such that if select all is done then all attachments must get selected
Below is my VF Page and i need to create select all checkbox such that if select all is done then all attachments must get selected and then user can delete them at a go.
VF PAGE
<apex:page ...
-1
votes
1answer
57 views
Records being randomly deleted
I was informed of some weird behavior of some custom records missing from our SF instance and after a little research I found that all of these missing records had been moved into the recycling bin ...
1
vote
1answer
20 views
Delete EventRelation also delete Event when using DELETE request with sObject Collections
I am getting an issue that when i use DELETE request with sObject Collections, to delete an EventRelation, it also delete the main event.
DELETE /vXX.X/composite/sobjects?ids=recordId,recordId
An ...
0
votes
1answer
61 views
How Do I Delete an Email from Content Builder Using REST API?
I can create an email with the REST API but I do not know how to delete one and I cannot find any information about it. Thanks for your help!
0
votes
1answer
44 views
Delete child record if a field of parent is updated using trigger
My code is:
trigger ClassCustomStatus on Class__c (before update) {
Set<Id> classSet = new Set<Id>();
for(Class__c c : Trigger.new){
if(c....
0
votes
1answer
90 views
After Deleting Parent Object in Master-Detail relation, what happens to the triggers we have created in child object
In a master detail relationship in child object if we created trigger on child object after delete.when parent is deleted will the trigger execute?
0
votes
0answers
6 views
Deleting a contactkey - does it remove it from a data extension
Was wondering what exactly happens when deleting a contact from all contacts. Does it remove them from a data extension as well? And will it remove their "send" history and metrics? I understand ...
0
votes
1answer
24 views
Can you query where contacts come from or add a filter to prevent deleted contacts from coming back?
I have been monitoring my all contacts and it has been jumping 10000+ every day. I doubt these are authentic contacts
Is it possible to somehow do a query of where these contacts are coming from?
...
0
votes
1answer
45 views
How to clone trigger.newmap when passing into a trigger hanlder [closed]
I was wondering how to clone trigger.newmap or how to still have access to the references associated to it when I want to pass this into a trigger handler.
1
vote
1answer
462 views
Delete classes/trigger from Prod via VSCode
I need to delete classes and a trigger from prod via VSCode. I have retrieved the according classes/trigger via package.xml into VSCode. There is the command "SFDX: Delete This from Project and Org", ...
0
votes
0answers
22 views
Is there a way to restrict file owner from deleting file out of the box. (In Professional Edition)
I have a requirement where , no one(not event owner of file) should be able to delete files attached to a object record out of the box. Cant write trigger as requirement is for professional addition....
0
votes
0answers
129 views
SFDX force:source:delete doesn't work for production [duplicate]
In DX, a command like this will delete apex classes in a sandbox:
sfdx force:source:delete -m ApexClass:XXXController,ApexClass:XXXControllerTest
However, when I run it against production, I get ...
3
votes
1answer
283 views
Scratch Org Limit Exceeded, Not Visible In Dev Hub
Today, while trying to deploy a fresh scratch org, I received a familiar error.
The signup request failed because this organization has reached its active scratch org limit
Typically the way to ...
0
votes
0answers
61 views
Stop Autolaunched Flow when Object Deleted
We are using Autolaunched Flows, many of which include Pauses of several days. Because of the Pauses, many Flows are throwing errors because the Objects that triggered them (via Process Builder) get ...
0
votes
1answer
181 views
Prevent child deletion when parent is status in Approved or Review and show error message on Parent
I have Master detail relation ship. I have written a trigger on child object to prevent the deletion of child when parent is in Approved or Inreview status and throw error message which is working ...
0
votes
3answers
110 views
Override Standard Delete Action on Account Object
how can i override standard delete action on Account with a Lightning component? I use Lightning Experience and i want when user selects delete action to show a message "Delete accounts is not ...
0
votes
1answer
29 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
57 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
84 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
153 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
703 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 ...
0
votes
1answer
94 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 ...
1
vote
2answers
493 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
109 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
37 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
19 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
17 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" ...