You need to sign in to do that
Don't have an account?
DML Row Limit Question
Hello, sorry if this has been answered before I've done a search on here and google and haven't found this specifically.
Do commands such as System.Now() or UserInfo.getUserId(); etc. count as DML requests?
Here is the code in question where I'm running into the issue pretty simple stuff:
trigger UpdateLeadPass on Lead (before update) {
Lead[] lead = Trigger.new;
Lead[] oldLead = Trigger.old;
if (lead != null && oldLead != null){
for(Lead leadPointer : lead) {
for (Lead oldPointer : oldLead) {
if (leadPointer.bdr_to_sr__c == True){
leadPointer.bdr_to_sr_rep__c = UserInfo.getUserId();
leadPointer.Transfer_Date__c = System.Now();
} else if (oldPointer.bdr_to_sr__c == True && leadPointer.bdr_to_sr__c == false) {
leadPointer.bdr_to_sr_rep__c = null;
}
if (leadPointer.bdr_to_ae__c == True){
leadPointer.bdr_to_ae_rep__c = UserInfo.getUserId();
leadPointer.Transfer_Date__c = System.Now();
} else if (oldPointer.bdr_to_ae__c == True && leadPointer.bdr_to_ae__c == false) {
leadPointer.bdr_to_ae_rep__c = null;
}
if (leadPointer.bdr_to_reseller__c == True){
leadPointer.bdr_to_reseller_rep__c = UserInfo.getUserId();
leadPointer.Transfer_Date__c = System.Now();
} else if (oldPointer.bdr_to_reseller__c == True && leadPointer.bdr_to_reseller__c == false) {
leadPointer.bdr_to_reseller_rep__c = null;
}
if (leadPointer.sr_to_ae__c == True){
leadPointer.sr_to_ae_rep__c = UserInfo.getUserId();
leadPointer.Transfer_Date__c = System.Now();
} else if (oldPointer.sr_to_ae__c == True && leadPointer.sr_to_ae__c == false) {
leadPointer.sr_to_ae_rep__c = null;
}
if (leadPointer.sr_to_reseller__c == True){
leadPointer.sr_to_reseller_rep__c = UserInfo.getUserId();
leadPointer.Transfer_Date__c = System.Now();
} else if (oldPointer.sr_to_reseller__c == True && leadPointer.sr_to_reseller__c == false){
leadPointer.sr_to_reseller_rep__c = null;
}
if (leadPointer.ae_to_reseller__c == True){
leadPointer.ae_to_reseller_rep__c = UserInfo.getUserId();
leadPointer.Transfer_Date__c = System.Now();
} else if (oldPointer.ae_to_reseller__c == True && leadPointer.sr_to_reseller__c == false) {
leadPointer.ae_to_reseller_rep__c = null;
}
}
}
}
}
I appreciate any responses, thank you!
-Jonathan
Could you explain what your issue is a little bit more? You're getting a Too Many DML Operations type error?