0
嘿,我正在寫一個類,並不斷收到此構造未定義的錯誤。我在另一個類中有一個類,在開始將字段分配給每個類元素之前,我正在執行所有查詢。Salesforce Apex構造未定義錯誤
當我在end for循環中構建approvalQuoteLineWrapper類時,我沒有收到任何錯誤。但是,當我嘗試構建approvalQuoteWrapper時,我不斷收到此錯誤。
構造函數沒有定義:[CustomApprovalsHomeComponentController.approvalQuoteWrapper]。(Id,Id,Id,Id,Id,String,String,String,String,String,Datetime,Decimal,List)色譜柱:23)
這裏是我的代碼:
public with sharing class CustomApprovalsHomeComponentController {
public class approvalQuoteLineWrapper{
public approvalQuoteLineWrapper(Id quoteLineId, Id productId, String productName, Decimal listPrice, Decimal discountPercentage, Decimal netPrice, Decimal quantity, Decimal extendedPrice){
this.quoteLineId = quoteLineId;
this.productId = productId;
this.productName = productName;
this.listPrice = listPrice;
this.discountPercentage = discountPercentage;
this.netPrice = netPrice;
this.quantity = quantity;
this.extendedPrice = extendedPrice;
}
public Id quoteLineId {get;set;}
public Id productId {get;set;}
public String productName {get;set;}
public Decimal listPrice {get;set;}
public Decimal discountPercentage {get;set;}
public Decimal netPrice {get;set;}
public Decimal quantity {get;set;}
public Decimal extendedPrice {get;set;}
}
public class approvalQuoteWrapper{
public approvalQuoteWrapper(Id approvalId, Id quoteId, Id opportunityId, Id approverId, Id accountId, Id ownerId, String paymentTerms, String billingFreq, String quoteStatus, String oppType, String approvalStatus, String accountName, Date quoteCreateDate, Decimal totalDiscount, List<approvalQuoteLineWrapper> quoteLineList){
this.approvalId = approvalId;
this.quoteId = quoteId;
this.opportunityId = opportunityId;
this.approverId = approverId;
this.accountId = accountId;
this.ownerId = ownerId;
this.paymentTerms = paymentTerms;
this.billingFreq = billingFreq;
this.quoteStatus = quoteStatus;
this.oppType = oppType;
this.approvalStatus = approvalStatus;
this.accountName = accountName;
this.quoteCreateDate = quoteCreateDate;
this.totalDiscount = totalDiscount;
this.quoteLineList = quoteLineList;
}
public Id approvalId {get;set;}
public Id quoteId {get;set;}
public Id opportunityId {get;set;}
public Id approverId {get;set;}
public Id accountId {get;set;}
public Id ownerId {get;set;}
public String paymentTerms {get;set;}
public String billingFreq {get;set;}
public String quoteStatus {get;set;}
public String oppType {get;set;}
public String approvalStatus {get;set;}
public String accountName {get;set;}
public Date quoteCreateDate {get;set;}
public Decimal totalDiscount {get;set;}
public List<approvalQuoteLineWrapper> quoteLineList {get;set;}
}
public List<approvalQuoteWrapper> itemsToApprove {get;set;}
public CustomApprovalsHomeComponentController(){
Map<Id, sbaa__Approval__c> approvalList = new Map<Id, sbaa__Approval__c>();
itemsToApprove = new List<approvalQuoteWrapper>();
for(sbaa__Approval__c items : [SELECT Id, sbaa__Approver__r.sbaa__User__c, Quote__c, sbaa__Status__c
FROM sbaa__Approval__c
WHERE sbaa__Approver__r.sbaa__User__c = :UserInfo.getUserID()])
{
approvalList.put(items.Quote__c, items);
}
List<SBQQ__Quote__c> quoteList = [SELECT Id, SBQQ__Account__c, SBQQ__Account__r.Name, SBQQ__Opportunity2__c, SBQQ__Opportunity2__r.Type, ApprovalStatus__c, CreatedDate, SBQQ__TotalCustomerDiscountAmount__c, OwnerId, SBQQ__PaymentTerms__c, SBQQ__BillingFrequency__c
FROM SBQQ__Quote__c
WHERE Id IN :approvalList.keySet()
AND ApprovalStatus__c = 'Pending'
ORDER BY CreatedDate DESC];
List<SBQQ__QuoteLine__c> quoteLineList = [SELECT Id, SBQQ__Product__c, SBQQ__Product__r.Name, SBQQ__ListPrice__c, SBCF_Approval_Discount__c, SBQQ__NetPrice__c, SBQQ__Quantity__c, SBCF_Price_per_user__c, SBQQ__Quote__c
FROM SBQQ__QuoteLine__c
WHERE SBQQ__Quote__c IN :approvalList.keySet()];
for(SBQQ__Quote__c quote : quoteList){
List<approvalQuoteLineWrapper> appQLineList = new List<approvalQuoteLineWrapper>();
for(SBQQ__QuoteLine__c quoteLine : quoteLineList){
if(quoteLine.SBQQ__Quote__c == quote.Id){
appQLineList.add(new approvalQuoteLineWrapper(
quoteLine.Id,
quoteLine.SBQQ__Product__c,
quoteLine.SBQQ__Product__r.Name,
quoteLine.SBQQ__ListPrice__c,
quoteLine.SBCF_Approval_Discount__c,
quoteLine.SBQQ__NetPrice__c,
quoteLine.SBQQ__Quantity__c,
quoteLine.SBCF_Price_per_user__c));
}
}
itemsToApprove.add(new approvalQuoteWrapper(
approvalList.get(quote.Id).Id,
quote.Id,
quote.SBQQ__Opportunity2__c,
approvalList.get(quote.Id).sbaa__Approver__r.sbaa__User__c,
quote.SBQQ__Account__c,
quote.OwnerId,
quote.SBQQ__PaymentTerms__c,
quote.SBQQ__BillingFrequency__c,
quote.ApprovalStatus__c,
quote.SBQQ__Opportunity2__r.Type,
approvalList.get(quote.Id).sbaa__Status__c,
quote.SBQQ__Account__r.Name,
quote.CreatedDate,
quote.SBQQ__TotalCustomerDiscountAmount__c,
appQLineList));
}
}
}
不知道我是缺少什麼。
在此先感謝! VS日期時間
你的構造函數使用日期