function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
HDLHDL 

Salesforce CPQ Advanced Approvals Apex Test Failure?

Hi Everyone,

I've created the Apex Classes referenced in the Salesforce article, "Enable an Object for Advanced Approvals."  

https://help.salesforce.com/s/articleView?id=cpq_enable_aa.htm&type=5&language=th

I've also created the Advanced Approvals buttons referenced here:

https://help.salesforce.com/s/articleView?id=sf.cpq_enable_aa_buttons.htm&type=5

I created a change set, and am in the process of validating it, but I've received two Apex Class failures, and I'm not sure what they're trying to tell me.  

QuoteExtControllerTests
testRecall
System.DmlException: Insert failed. First exception on row 0; first error: CANNOT_EXECUTE_FLOW_TRIGGER, We can't save this record because the “PB: CPQ Quote” process failed. Give your Salesforce admin these details. This error occurred when the flow tried to update records: INVALID_TYPE_ON_FIELD_IN_RECORD: Fuel Surcharge: value not of required type: . You can look up ExceptionCode values in the SOAP API Developer Guide.value not of required type: . You can look up ExceptionCode values in the SOAP API Developer Guide.: []
Stack Trace: Class.QuoteExtControllerTests.testRecall: line 19, column 1

QuoteExtControllerTests
testSubmit
System.DmlException: Insert failed. First exception on row 0; first error: CANNOT_EXECUTE_FLOW_TRIGGER, We can't save this record because the “PB: CPQ Quote” process failed. Give your Salesforce admin these details. This error occurred when the flow tried to update records: INVALID_TYPE_ON_FIELD_IN_RECORD: Fuel Surcharge: value not of required type: . You can look up ExceptionCode values in the SOAP API Developer Guide.value not of required type: . You can look up ExceptionCode values in the SOAP API Developer Guide.: []
Stack Trace: Class.QuoteExtControllerTests.testSubmit: line 6, column 1

I have a process builder called PB: CPQ Quote which takes the values from the account, and populates them on the quote level when created for use in Salesforce CPQ through some other processes.  The field referenced, Fuel Surcharge, is a checkbox field on both the account and quote level, and the process builder just references the field.

Anyone have any thoughts as to why the apex tests might be failing?

I greatly appreciate your help here.
Hara SahooHara Sahoo
Can you tell us what is the field type for Fuel Surcharge and what value is being inserted by the flow?
INVALID_TYPE_ON_FIELD_IN_RECORD: Fuel Surcharge: value not of required type
HDLHDL
It is a checkbox, and the value being inserted by the flow is the value of the checkbox from the account (true or false) to the value on the quote object (which is just replicating the value on the account).