Our org inherited a complex screen flow that uses an LWC to create and update contact records. The flow works just fine when run as sysadmin, but does not work when run as a standard user. I confirmed the standard user has permission to create and update the contact records that the screen flow is trying to modify. I even wrote a separate screen flow that uses the "create record" function, and that works when run as the standard user.

The LWC uses the createRecord and updateRecord standard calls (import { updateRecord, createRecord } from 'lightning/uiRecordApi';). The createRecord piece looks like this:

            .then(contact => {
                // Set contact id output
                console.log('objRecordInput.Id = '+contact.id);
                this.ContactIdOut = contact.id;
                // navigate to the next screen
                const navigateNextEvent = new FlowNavigationNextEvent();
                this.loading = false;
            .catch(error => {
                if (Array.isArray(error.body)) {
                    this.error = error.body.map(e => e.message).join(', ');
                } else if (typeof error.body.message === 'string') {
                    this.error = 'Failed to create record: ' + error.body.message;                    }
                this.loading = false;                    

When I run the flow as the standard user, I get "Failed to create record: An error occurred while trying to update the record. Please try again."

That message is not particularly helpful to me. I don't know enough javascript to figure out how to get a better error message to find out what is really going on. I've also tried disabling all workflows, process builders, other flows, and validation rules, in case those were somehow causing it to fail in the background. The fact that the flow works as sysadmin though leads me to think it's a permissions problem. I've tried setting the flow to run in all 3 different contexts (user, system with sharing, system without sharing) and nothing works. I also posted this message in the LWC trailhead forum and got nothing useful. The updateRecord call fails with a similar error.

Any ideas on why it might be failing, or what other debugging/logging I can do to help track down the culprit?

Thanks, Bill

  • 1
    Have you taken a look at the FLS? Oct 14, 2023 at 15:51
  • can you log the contact id which screenflow is trying to update. then check if concerned user has read/write sharing access for that record. Oct 14, 2023 at 16:00
  • I do not believe it is a field level security issue, unless at least not in the traditional sense. Through the regular UI, the standard user can edit the contact record, and she can also create new contacts on the account. It's only when trying to add/edit through the LWC that it fails.
    – Bill Smith
    Oct 14, 2023 at 18:49

1 Answer 1


I stumbled upon the "pause on caught exception" setting on the js debug console, which was the key to seeing what was really happening. That showed that the error was in fact a field-level security problem after all.

A couple things I learned along the way:

  1. You can't trust the "run as another user" when debugging a flow to properly execute permissions correctly. This flow worked without error when running as a standard user in flow debug.

  2. The "An error occurred while trying to update the record" message from Salesforce is misleading. Since it said "update failed," I thought perhaps the record creation was succeeding, and that a secondary process was updating a record and failing. However, I found the "update error" text is in the branch of Salesforce's create record function. I wasted a few hours going down the wrong rabbit hole based on that alone.

You must log in to answer this question.

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