You need to sign in to do that
Don't have an account?
Apex error in UAT after refresh from Production
We are using an Apex class to allow users to select and insert a value (Extraction Vehicle) on a CPQ Quote Line (Apex Class named qtc_ExtractionCTRL). This Apex Class worked fine in the UAT environment until UAT was refreshed from Production. The Apex Class code is shown below:
public class qtc_ExtractionCTRL {
public String qlId {get;set;}
public ExtractionVehicle__c theExtraction {get;set;}
public List exList {get;set;}
public qtc_ExtractionCTRL(){
this.qlId = Apexpages.currentPage().getParameters().get('Id');
this.theExtraction = new ExtractionVehicle__c();
this.exList = [SELECT Id, ExtractionVehicleName__c, QuoteLine__c FROM ExtractionVehicle__c WHERE QuoteLine__c =: qlId];
}
public void Submit()
{
theExtraction.QuoteLine__c = qlId;
Database.insert(theExtraction);
theExtraction = new ExtractionVehicle__c();
exList = [SELECT Id, ExtractionVehicleName__c, QuoteLine__c FROM ExtractionVehicle__c WHERE QuoteLine__c =: qlId];
}
}
The error that we see when the Apex Class fires is:
"Invalid id:
Error is in expression '{!Submit}' in component in page qtc_extraction: Class.qtc_ExtractionCTRL.Submit: line 15, column 1
An unexpected error has occurred. Your development organization has been notified."
The line in question is : theExtraction.QuoteLine__c = qlId;
From what I can figure, the Class is referencing Production somehow. I am not sure how.
public class qtc_ExtractionCTRL {
public String qlId {get;set;}
public ExtractionVehicle__c theExtraction {get;set;}
public List exList {get;set;}
public qtc_ExtractionCTRL(){
this.qlId = Apexpages.currentPage().getParameters().get('Id');
this.theExtraction = new ExtractionVehicle__c();
this.exList = [SELECT Id, ExtractionVehicleName__c, QuoteLine__c FROM ExtractionVehicle__c WHERE QuoteLine__c =: qlId];
}
public void Submit()
{
theExtraction.QuoteLine__c = qlId;
Database.insert(theExtraction);
theExtraction = new ExtractionVehicle__c();
exList = [SELECT Id, ExtractionVehicleName__c, QuoteLine__c FROM ExtractionVehicle__c WHERE QuoteLine__c =: qlId];
}
}
The error that we see when the Apex Class fires is:
"Invalid id:
Error is in expression '{!Submit}' in component in page qtc_extraction: Class.qtc_ExtractionCTRL.Submit: line 15, column 1
An unexpected error has occurred. Your development organization has been notified."
The line in question is : theExtraction.QuoteLine__c = qlId;
From what I can figure, the Class is referencing Production somehow. I am not sure how.