You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
PaymentProcessor_PreventMultipleDefaults.trigger doesn't allow editing the current default record; trying to save after an edit throws "Error:You have already selected a Payment Processor as the Default Processor. Please uncheck this option to save this record."
The text was updated successfully, but these errors were encountered:
trigger PaymentProcessor_PreventMultipleDefaults on gwop__Payment_Processor__c (before insert, before update) {
//first query to see if there is a default processor
Payment_Processor__c[] processors = [SELECT id FROM Payment_Processor__c WHERE Default_Connection__c = true];
if (!processors.isEmpty()) {
for (Payment_Processor__c p : trigger.new) {
if (p.Default_Connection__c && (trigger.isInsert || p.id!=processors[0].id)) {
p.addError('You have already selected a Payment Processor as the Default Processor. Please uncheck this option to save this record.');
}
}
}
}
PaymentProcessor_PreventMultipleDefaults.trigger doesn't allow editing the current default record; trying to save after an edit throws "Error:You have already selected a Payment Processor as the Default Processor. Please uncheck this option to save this record."
The text was updated successfully, but these errors were encountered: