1

I'm attempting to create a record trigger flow on User that sets permissions for the new user after the community user is activated, but I'm not even able to get that far.

My User Record Trigger flow, specifically when it's activated from enabling a new customer experience user, fails every time I try to create or update a record.

Error Message: Unable to Access Page The value of a parameter contains a character that is not allowed or the value exceeds the maximum allowed length. Remove the character from the parameter value or reduce the value length and resubmit.

Things I've tried: I've tried using the Contact ID field on the User and updating directly, and I've tried looking up the Contact with that field and with a hard coded value and updating that. I've turned off all other automation on a few different records to see if I could create them, no success. I've tried a bunch of other flow elements and they all seem to work fine. I tried running it async, or scheduled it for 2 minutes after creation, but it never happened. I also didn't see it in paused flow interviews or in scheduled jobs. Per other questions here with similar errors, I'm confident there are no null values and this has nothing to do with opportunities or currencies.

When I test in debug, either create or update, it works fine. It also works when I update a user record directly. It just doesn't work when I am enabling a customer experience user. Is this expected?

My main workaround is that after I activate the user, I have a button on the contact I click to update everything. But sometimes my users forget to press it and I can't figure out another way to automate it. I am open to workaround ideas as well.

Edit: After digging into the apex logs I was able to find this error: MIXED_DML_OPERATION: DML operation on setup object is not permitted after you have updated a non-setup object (or vice versa)

2
  • is this an after-save record-triggered flow?
    – cropredy
    Feb 16, 2022 at 1:26
  • Good question, yes it is. @cropredy Feb 16, 2022 at 5:29

2 Answers 2

0

OK, here's a possibility for why this happened based on an experiment I did in a Trailhead Playground

You can get the error:

Unable to Access Page The value of a parameter contains a character that is not allowed or the value exceeds the maximum allowed length. Remove the character from the parameter value or reduce the value length and resubmit. If the error still persists, report it to our Customer Support team. Provide the URL of the page you were requesting as well as any other related information.

if the Flow is attempting to create a PermissionSetAssignment for the same permission set twice.

This could happen for several reasons, including:

  • The Flow is set to execute on Create and Update and you have other automation on User that causes an update after the initial enablement of the Customer Community user

My recommendation would be to rework the Flow to either:

a) Run on Create only or ...

b) Query for the PermissionSetAssignment between the User record and PermissionSet - if present, don't create a duplicate PSA. Same would be true for PSAs between User and PermissionSetGroup if you use those.

Note that the Flow exception will appear in the email where Flow exceptions go (see Setup | Process Automation Settings) and will correctly diagnose the issue:

This error occurred when the flow tried to create records: DUPLICATE_VALUE: Duplicate PermissionSetAssignment.

0

In the developer console I was able to find an error that gave a bit more detail. It seems when you update a setup object (User) you cannot then update many other objects.

Link to the a question with an answer to that, including a workaround for apex. DML operation on setup object is not permitted after you have updated a non-setup object

You must log in to answer this question.

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