-
-
Notifications
You must be signed in to change notification settings - Fork 171
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
Logging as Guest User Fails #145
Comments
Wanted to quickly follow up on this that I was able to get around this for now replacing the line that sets the log.OwnerId in the LogEntryEventHandler class, obviously this is not ideal if I need to update the Nebula logger, but it will allow me to continue with my use case. In case anyone is curious I just added an additional custom setting checking for the profile name which was already available from the logEntryEvent.ProfileName__c, and then defaulting back to the Autoprocess User as owner if not. log.OwnerId = Extended_Logger_Settings__c.getValues('Extended Logger Settings').Guest_Profile_Names__c.Contains(logEntryEvent.ProfileName__c) ? System.UserInfo.getUserId() : logEntryEvent.CreatedById; FYI unrelated, about 4 lines below, this line of code sets the log's SessionId is set twice.
I would still very much appreciate an alternative work around that may be more suitable, if one exists. |
Hi @mykah89 thanks for reporting this! I think your workaround of setting the record owner to the 'Automation Process' user (instead of the guest user) makes sense/seems like a great solution - I'll try to fix this sometime within the next few weeks. |
Thanks for the response. I'm sure you are well aware already but just in case, In my research it looks like System.UserInfo.userType() may return type guest, which if passed through the call chain would make this a smooth operation. Thanks again, this library has saved me hours of time already. |
Thanks @mykah89 - If Glad to hear that the logger has been helpful & saved you time! If you find any other bugs or have any suggestions for new features, just let me know! |
@mykah89 I've merged a fix for this to the Let me know if you have any other issues! |
This is great, much appreciated, I had to refactor some of the calls I was using that used Topics, but other than that I was able to install the Unlocked Package right over the deployed metadata without issue. Thanks again. |
@mykah89 glad you were able to successfully switch to the unlocked package! And I'm hoping to spend some more time expanding the functionality for Topics - hopefully within the next few weeks. |
Apologies in advance, I'm relatively new to Salesforce development, I recently began using the logger successfully but I think I may have quickly come across an edge case.
Perhaps an obscure requirement but I'm looking to log from a public site with a @RestResource endpoint, I'm getting the following error when I trace the Automated Process user.
field integrity exception (Guest users cannot be record owners.)
It makes sense as to why I'm getting the error, but I was wondering if there was any work around here?
The text was updated successfully, but these errors were encountered: