Questions tagged [dmloptions]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
4 votes
1 answer
95 views

Inconsistent behavior of setting DmlOptions - DuplicateRuleHeader

Per the Apex doc - you can set DMLOptions either on the sobject directly or via the dmlOptions parameter of the Database.XXX methods You can specify DML options for insert and update operations by ...
user avatar
  • 62.4k
0 votes
1 answer
235 views

Bypass Case Assignment Rule set with DMOptions

I have an apex class assigning a rule to all cases global class AP04_CaseCallAssignmentRule { /* this method is invoked from process builder for reassigning case */ @InvocableMethod(...
user avatar
0 votes
1 answer
342 views

Skip case assignment rule- Email to Case

I have cases created through email to case and assigned using active assignment rule. In some criteria , I need to assign the case to the specific owner and want to skip the assignment rule in those ...
user avatar
0 votes
0 answers
351 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 ...
user avatar
0 votes
1 answer
171 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 ...
user avatar
1 vote
1 answer
861 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 ...
user avatar
1 vote
3 answers
2k 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 ...
user avatar
  • 55
2 votes
1 answer
1k 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 ...
user avatar
  • 1,565
4 votes
1 answer
401 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 ...
user avatar
  • 1,862
1 vote
0 answers
49 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 ...
user avatar
  • 4,972
2 votes
3 answers
177 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) ...
user avatar
  • 1,080
4 votes
1 answer
2k 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 ...
user avatar
  • 924
1 vote
0 answers
52 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(...
user avatar
0 votes
1 answer
227 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}/> ...
user avatar
  • 3,472
4 votes
1 answer
2k 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....
user avatar
3 votes
1 answer
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....
user avatar
  • 5,606
2 votes
1 answer
983 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('@@ ...
user avatar
  • 5,606
4 votes
1 answer
694 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 ...
user avatar
  • 3,548