1

For some reason, the accounts that are created by our custom form on our Lightning Community does not show the "Created" entry on the Account History section. It shows the account was created by the Community Guest User, but it skips the "Created" history record.

On records created inside the Salesforce UI, it shows the "Created" history record.

How can I have SF record the "Created" entry in the Account History when the account is created by the Community Guest User?

1 Answer 1

2

Had the same issue. Solved it.

Check if the user the record was updated by has create/edit permission on the account object. If not that's the reason why you don't see the creation date in the field history. Probably the trigger used the without sharing keyword to create those accounts. To fix the issue give create/edit permission to the user.

"Another important consideration is the context of the user executing the Apex code. By default, Apex executes in system context. Apex code has access to all objects and fields. Object permissions, field-level security, and sharing rules aren’t applied for the current user. You can use the with sharing keyword to specify that the sharing rules for the current user be taken into account for a class. This topic is important, so check out Using the with sharing or without sharing keywords." (https://trailhead.salesforce.com/en/content/learn/modules/apex_basics_dotnet/execution_context)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.