0

I am trying to create a flow test using the new functionalities. It is a record-triggered flow on Account create and update, and the current test is for Account update. However, when I run the test, I get the error message :

"An error occurred while saving the triggering record: Record Type ID: this ID value isn't valid for the user: XXXXXXXXXXXXX"

As a system admin, I have access to the record type in question, as well as having flow management and view all data permissions. The flow can run normally with no errors. Is there a specific profile I need to modify for flow tests?

Note: If it is relevant, the record type in question is the NPSP Household Account.

2
  • Did you try to debug the flow and check what recordtypeid you are getting and which element it is failing? Aug 11, 2022 at 2:23
  • Yes, but it doesn't help because that's not when the failure happens. When I run the flow, either normally or in debug, it runs without issues, RecordTypeId is properly set, and no element fails. It is only when using the flow tests that there is an issue. During the flow test, the record type ID is what I expect it to be, it just says I don't have permission to save it.
    – ZSSF
    Aug 11, 2022 at 15:20

1 Answer 1

0

I ran into a similar situation but it was the Id of the record chosen to test on. I assumed that the record I was picking for the test was the one being triggered but it turns out the actual record triggered was set to a different record of the same object type for some strange reason and even weirder--the record that was firing appeared deleted. In your case, I imagine the RecordTypeId is null for a similar reason, the record being triggered in the test is deleted, that explains why it woks fine in debug.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .