Questions tagged [dmloptions]

The tag has no usage guidance.

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

Test Class - SOQL in Test Returns No Results using Database.Insert(RecordList,DML), but works using Database.Insert(RecordList)?

I am creating test coverage for a new Lead Process we've built for our company. To properly test this deployment, I need a list of Leads to show as being Inserted by our Pardot API connector user, and ...
0
votes
1answer
46 views

Optimal number of records per batch

I have a problem executing a batch in some limit cases that i want to cover to avoid future concerns. The scenario is the following: My batch works on n(reasonable high number) records of the same ...
1
vote
1answer
163 views

Re-running Lead Assignment Rules

I'm trying to run lead assignment rules from an invocable method, but it doesn't seem to be actually updating the lead assignment according to the rules (or at all!) We have a process by which users ...
1
vote
2answers
580 views

Sending Email to Queue Members On Lead Creation Without Using Assignment Rules

I have 2 Users that belong to the queue 'Sales' with the Send Email to Members checked. I have an online app that creates a new lead, and sets various lead fields, but the email is not sent to ...
2
votes
1answer
478 views

Case Assignment rule is not working in Custom Lightning Page

We are using custom case page in Lightning with Lightning Component. On insert on case, it is going to default case Queue. On update on case it is not going to other queue according to assignment ...
4
votes
1answer
112 views

DMLOptions - AllowFieldTruncation not working

I have batch classes performing callout + [insert, update, upsert], so I set up everything about DML first: this.dml = new SObjectUnitOfWork.DatabaseDML(); this.unitOfWork = new ...
1
vote
0answers
39 views

Language of record owner email change

We have built some custom owner change logic for tasks, leads and opportunities, but now I want to know how is the language of the email decided? Example code: Database.DMLOptions dmlo = new ...
2
votes
3answers
93 views

Comparing @future vs non-future and beforeUpdate vs afterupdate when using DMLOptions to perform LeadAssignment in an Apex Trigger

When using Apex Database.DMLOptions for invoking standard Lead Assignment Rules, is it sane to use beforeUpdate instead of afterupdate? And is it sane to do this in non-future apex vs (as opposed to) ...
3
votes
1answer
569 views

DuplicateRuleHeader.AllowSave = True not working?

I've currently enabled duplicate rules for the Contact object and specified the "Action on Create" and "Action on Edit" to "Block" incoming duplicate Contact records. When testing with the example ...
1
vote
0answers
48 views

Test method failure - expecting a DML error but not getting one

I have a test method that is failing because it is expecting an error, but isn't getting one. Here's the test method: static testMethod void assignToSelf_DmlError() { setup(); Test.startTest(...
0
votes
1answer
216 views

How to activate assignment rules using controller's save method?

I have a Visualforce Page that overrides standard New Case page. It uses the Case StandardController, along with a controller extension. The page has an <apex:commandButton action={!Save}/> ...
4
votes
1answer
1k views

Send email notification when task is created

Task t = new Task(); t.WhatId = 'custom object Id'; t.OwnerId = 'userid'; t.Subject = 'Test'; t.Priority = 'High'; t.Status = 'Test Status'; t.Description = 'Test Note.Description__c'; Database....
3
votes
1answer
2k views

Task Email Notifications via APEX not working, could be a Bug in platform or as designed after Winter 15?

Database.DMLOptions dm = new Database.DMLOptions(); dm.EmailHeader.triggerUserEmail = true; Task t = new Task(Subject='Test Task', ActivityDate=date.today(), OwnerId='00590000000wND2'); database....
2
votes
1answer
667 views

Why would DmlOptions EmailHeader not work for Event Creation with email notifications?

I have a code sample as below: Database.DMLOptions dmlo = new Database.DMLOptions(); dmlo.EmailHeader.triggerUserEmail = true; database.insert( this.myNewEventsWithEmail, dmlo ); system.debug('@@ ...
4
votes
1answer
408 views

What are these DMLOptions.DuplicateRuleHeader Properties?

The new Duplicate Management brings in the new DMLOptions class DuplicateRuleHeader. According to the Documentation, the property allowSave can be set to true, to force the database to ignore ...