Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to specify specific contact under account if they share email addresses. #37

Open
aaronhunt230 opened this issue Sep 16, 2024 · 1 comment
Labels
documentation Improvements or additions to documentation help wanted Extra attention is needed

Comments

@aaronhunt230
Copy link

I've noticed that even if only one contact is identified in the custom SOQL on the component using some other identifier, it is still possible for the wrong contact to be associated with the created Site User if that contact shares a matching Email Address.

This may be an issue with the Site.CreateExternalUser method: createExternalUser(user, accountId, password)

According to the documentation, it seems to look for any contact under the Account with a matching email.

Thought I would raise this issue for awareness, maybe there is a workaround.

@jloweSFDC
Copy link

Interesting find in the documentation. It would seem to defeat the point of going to the trouble of identifying and setting the ContactId on the user object that is passed in as the first parameter. The only workaround I can think of would be to manually craft and inserting the user, setting a ContactId at the point of creation (i.e the one found from the query) and password by using the System.SetPassword() method. However, reading on Stackoverflow I think these methods come with their own issues so will need to explore further...

@jloweSFDC jloweSFDC added documentation Improvements or additions to documentation help wanted Extra attention is needed labels Sep 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants