The Stack Overflow podcast is back! Listen to an interview with our new CEO.

Hot answers tagged

6

method named accountsByState that accepts a state abbreviation as a string and returns a List of Account objects You are not passing the parameter for state. public static List<Account> accountsByState(String stateAbbr) { return [SELECT Id, Name, BillingState FROM Account WHERE BillingState=:stateAbbr]; }


2

You passed the maps into your handler code so you really just need to compare them by using the acc ID as the key between the two maps for (Account acc_i : accMap.values()) { if(acc_i.IsActive__c==true && acc_i.IsActive__c != accoldMap.get(acc_i.Id).IsActive__c){ System.debug('You can update'); acc_i....


1

If you want your trigger to fire only when IsActive__c is changed to true, then you will have to check for two conditions. Old value of IsActive__c is not same as new value of IsActive__c New value of IsActive__c is true So that is how your condition should be, so replace below code if(acc_i.IsActive__c==true) with if(acc.IsActive__c != accoldMap.get(...


1

NPSP's Customizable Rollups feature is designed to facilitate complex, filtered rollups of giving data, from Opportunities and Payments, based upon hard or soft credit mechanics. The feature doesn't provide fully generalized rollups of any object to any object. You can read about the types of CRLPs that are available in NPSP documentation. You've selected ...


1

You need to ensure that the ShippingState field has the same value as the BillingState field before records are saved. You need to invoke it in before insert context and assign BillingState to ShippingState Trigger: trigger AccountTrigger on Account (before insert) { if(Trigger.isBefore && Trigger.isInsert) AccountTriggerHandler....


Only top voted, non community-wiki answers of a minimum length are eligible