0

任务是在满足某些条件时订购报价单,以便可以订购报价单。我对映射和签名有疑问,

public interface CPQ_ITriggerHelper{
     void execute(Map<Id, SObject> newMap, Map<Id, SObject> oldMap>);
}

这是即兴代码

public static void merchantApproved(List<SBQQ__QuoteLine__c> quoteList)
{
    Set<Id> quoteIds = new Set<Id>();
    for(SBQQ__Quote__c q : quoteList)
    {
        quoteIds.add(q.SBQQ__Status__c);
    }
    
    Map<Id, SBQQ__Quote__c> oldMap = new Map<Id, SBQQ__Quote__c>
        (
            [
                SELECT Id, SBQQ__Status__c 
                FROM SBQQ__Quote__c 
                WHERE Id 
                IN :quoteIds
            ]
        );

    for(SBQQ__Quote__c q : quoteList)
    {
        if(quoteList.oldMap(q.Id).SBQQ_Status__c == quoteList.newMap.get(q.Id).SBQQ__Status__c
           && quoteList.newMap(q.Id).SBQQ__Status__c == 'Merchant Approved')
        {
            //Have to create Order if status 'Merchant Approved' is met. Help
        }
    }
}

错误是:方法不存在或签名不正确:类型列表中的 void old 和 newMap(id)。

4

0 回答 0