+ Start a Discussion
ramesh infyramesh infy 

Test class fail on invocable apex class of process builder

I have written a test on invocable apex class used in process builder and its failed. plz find the below code and help me out where i am going wrong also atteched the error 

Error --
System.DmlException: Insert failed. First exception on row 0; first error: CANNOT_EXECUTE_FLOW_TRIGGER, We can't save this record because the “Account Owner Change” process failed. Give your Salesforce admin these details. <b>An unhandled fault has occurred in this flow</b><br>An unhandled fault has occurred while processing the flow.  Please contact your system administrator for more information.: []

code --
public class RequestPortalRecordsTest {

    static testMethod void OwnerUpdateMethodTest() {
        Food_Service_Bulk_Data_Processing_Limit__c c=new Food_Service_Bulk_Data_Processing_Limit__c();
        insert c;
          Account acc = new Account();
          acc.Name = 'TestAccount';
       insert acc;
       Request_Portal__c rp = new Request_Portal__c ();
        rp.Account_Name__c = acc.id;
        insert rp;
        List<Request_Portal__c> rpList = new List<Request_Portal__c> ();
         //  public static void ReqChange(List<Request_Portal__c> rp)
Hi Ramesh,

You are not adding the request portal object to the list which you are passing as a parameter to the class "RequestPortalRecords.req(rpList);

Thank You,
Rajesh Adiga P.