sfdc触发器,代码覆盖率为0%。我需要1%来配置触发器

时间:2015-05-19 16:47:58

标签: salesforce

这个触发器是否正确?我无法部署它。

trigger AccountSurveyTrigger on Account_Survey__c (after delete, after insert, after undelete, after update) {

            List<Account_Survey__c> childObjectList;
            List<Account_Survey__c> oldChildObjectList;
            if( Trigger.isDelete ) {
                childObjectList = Trigger.old;
            } else {
                childObjectList = Trigger.new;
            } 

            //Pass in the name of the child record, in this case 'Contact' and the name of the parent record, in this case 'Account';   
            LookupRollupHelper lh = new LookupRollupHelper( 'Account_Survey__c', 'Account');
            lh.doMathQuery = true;
            lh.mathQueryType = 'AVG';

            //Convert the Trigger.list to a list of sObjects
            if(Trigger.isUpdate) {
                lh.rollupSummary((List<sObject>)childObjectList, (List<sObject>)Trigger.old);
            } else {
                lh.rollupSummary((List<sObject>)childObjectList, null);
            }

            AccountSurveyHelper.findMostRecentNPS(trigger.new);
            System.debug('After finding most recent');

0 个答案:

没有答案