You need to sign in to do that
Don't have an account?
Scott Walker
Process builder error. Really need help!
So I have an issue with a flow. When I did a test it worked but now its not and I have no idea why. The error message makes very little sense to me but appears to be an issue with the student field?
Can anyone help me with this:
I have mapped the fields and I believe they are correct, as follows:
the fields on the right are:
Student__c
Amount_Paid__c
CreatedDate
Any help really appreciated I really need to get this to work
Can anyone help me with this:
Error element myRule_1_A1 (FlowRecordCreate). This error occurred when the flow tried to create records: CANNOT_INSERT_UPDATE_ACTIVATE_ENTITY: Meal_Transaction_AIAIAD: execution of BeforeInsert caused by: System.ListException: List index out of bounds: 0 Trigger.Meal_Transaction_AIAIAD: line 24, column 1. For details, see API Exceptions. This report lists the elements that the flow interview executed. The report is a beta feature. We welcome your feedback on IdeaExchange. Flow Details Flow Name: Payment_Meals_Update_Ver_3 Type: Workflow Version: 1 Status: Active Flow Interview Details Interview Label: Payment_Meals_Update_Ver_3-1_InterviewLabel Current User: Scott Walker (00XX000000#XXXXXXX) Start time: 4/3/2017 4:46 PM Duration: 0 seconds How the Interview Started Scott Walker (00X0000000000) started the flow interview. Some of this flow's variables were set when the interview started. myVariable_old = null myVariable_current = a00000000aa0000008 ASSIGNMENT: myVariable_waitStartTimeAssignment {!myVariable_waitStartTimeVariable} Equals {!Flow.CurrentDateTime} Result {!myVariable_waitStartTimeVariable} = "4/3/2017 4:46 PM" DECISION: myDecision Executed this outcome: myRule_1 Outcome conditions: and 1. {!myVariable_current.Payment_for__c} (Lunch Billing) Equals Lunch Billing Logic: All conditions must be true (AND) RECORD CREATE: myRule_1_A1 Create one Meal_Transaction__c record where: Student__c = {!myVariable_current.Student__c} (null) Transaction_Amount__c = {!myVariable_current.Amount_Paid__c} (1) Transaction_Date__c = {!myVariable_current.CreatedDate} (4/3/2017 4:46 PM) Transaction_Type__c = Credit Result Failed to create record. Error Occurred: This error occurred when the flow tried to create records: CANNOT_INSERT_UPDATE_ACTIVATE_ENTITY: Meal_Transaction_AIAIAD: execution of BeforeInsert caused by: System.ListException: List index out of bounds: 0 Trigger.Meal_Transaction_AIAIAD: line 24, column 1. For details, see API Exceptions.
I have mapped the fields and I believe they are correct, as follows:
the fields on the right are:
Student__c
Amount_Paid__c
CreatedDate
Any help really appreciated I really need to get this to work
Copy the class code from here and past it there. then save the class.
refer the image below.
For replace a trigger code:
open your trigger. click on Edit button on that page, copy this trigger code and replace there. save it.
hope this will help you.
Thanks
karthik
All Answers
Lets do the check firs:
make your trigger inactive : "Trigger.Meal_Transaction_AIAIAD"
Then try to excute process builder alone. if its work perfectly then below is the reason for your issue.
may be your trigger "Trigger.Meal_Transaction_AIAIAD" and process builder insert falls in to Recursive event. make sure your trigger run only once when the event triggerd and use trigger context variable, make some boolean value set to true. if trigger run once make that false to avoid the trigger running and running again.
conside below example code for trigger Optimization.
Sample class code:
https://help.salesforce.com/articleView?id=000133752&type=1
Sample Trigger Code:
Hope this will help you.
Thanks
karthik
Thaks so much for this. The process builder does seem to work fine on its own. I am not a coder (yet, im learning) but how do I update what I have to make it function as I should, I got the code above from an error report that gets sent to me in an email due to failure. I am not entirely sure what I am doing
Once again, thanks so much for your help here.
Get this trigger code "Trigger.Meal_Transaction_AIAIAD" and try to share it here.. i will look in to this trigger part.
Thanks
karthik
First setp : Create a new class using below code.
Replace you trigger code with below code: take a backup of your code before replace.
Now activate your trigger and try to check your process builder test. it should work.
Hope this will help you.
Thanks
karthik
Copy the class code from here and past it there. then save the class.
refer the image below.
For replace a trigger code:
open your trigger. click on Edit button on that page, copy this trigger code and replace there. save it.
hope this will help you.
Thanks
karthik