Questions tagged [dml]

Use this tag for questions about DML, the data manipulation language used in apex to perform operations as insert, update, delete, and restore data in the database.

62 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
0
votes
0answers
57 views

Trigger is working fine for inserting records but not working on update of records

I have written a trigger to update one lookup field of invoice with salesquota object id.This triggers work fine when i am inserting records.But when i try to update records with few changes it is not ...
0
votes
1answer
184 views

Insert Operation using Map Instead of List

How can I implement insert operation using map collection instead of list? I've created a conference scheduling app wherein upon selecting a certain student from a picklist, a table containing ...
0
votes
0answers
107 views

Able to make isactive = false for such users who are manager of some other users

I am able to make isactive=false for such users who are manager of some other users.As per salesforce funtionality i should not be able to make isactive=false using DML as it will throw dependency ...
0
votes
1answer
148 views

Successful DML operation not getting updated in database

I am using below code for batch update : List<Database.SaveResult> updateResults; updateResults = Database.update(listUserDeactivate, false); System.debug('value of users for ...
0
votes
1answer
100 views

Param values are not being passed to the custom controller using commandbutton

Need pro's help. Below are my code snippets. This is what I have tried I have initialized the object Event_Request__c {get; set;} in my controller class. I have created a public method to update the ...
0
votes
0answers
32 views

Unexpected System.CalloutException in test while using startTest method

@isTest global class xxx_UT implements WebServiceMock { static { Account account = new Account(Name = 'Test Account'); insert account; Qwerty__c q = new Qwerty__c(); insert q; ...
0
votes
0answers
669 views

Upsert throws Missing Argument exception. Any thoughts please?

I tried to upsert and my code is below. But i am getting an exception and nothing is inserted or updated. Any thoughts please. if(lstp.size()>0) { Boolean isUpsertfirstTime = true; try { ...
0
votes
0answers
60 views

Trigger upon change in formula field result

I have standard object - ServiceContract, on which there is a formula field Status__c. Lets assume the formula field does this "StartDate__c>=Today>=EndDate__c, status=Active, else status=Expired" ...
0
votes
1answer
288 views

Map of attachment insertion

I have a map with String value and list of attachments. I am getting those by inputfile but not being able to insert those. Please find my snippet as below. Can someone please help? Apex page: ...
0
votes
0answers
1k views

Too many DML statements: 151 - no DML in a for loop (that I can see)

I'm trying to build a newsletter manager that allows users to easily update and clear newsletter campaign members based on their subscription and region without having to run multiple reports. I've ...
0
votes
0answers
40 views

Update fails without error

I have below class where update on mycallsInc not happening. Can someone please help me? public void Publish() { List<Incident_abv__c> selIncs = (List<Incident_abv__c>)contr....
0
votes
0answers
33 views

Track records update based on User entry

I have a requirement to show five sections with different SOQL querry records. Now one common field in all of them is an input text PICKLIST field. While doing update I want to track only those ...

1 2