Oct 20 2022 01:54 AM
In modern SharePoint Events web part, if you attempt to create an event, and add a participant user that has an apostrophe in their username, an error occurs:-
"Can't save this event. Refresh this page and try again or contact the site owner. The query string logonName is missing or invalid."
Nov 09 2022 08:43 PM
@PaulL Seems like a bug in Microsoft functionality (APIs used behind the scene to create events).
Raise a support ticket with Microsoft directly and report this issue: Get M365 support - online support
Also, curious to know what is the error message in browser console? What is the API URL generated and shown in console?
Please click Mark as Best Response & Like if my post helped you to solve your issue. This will help others to find the correct solution easily. It also closes the item. If the post was useful in other ways, please consider giving it Like.
Nov 25 2022 04:13 PM
@ganeshsanap the error is generated by a batch call to web.ensureuser. The apostrophe is clearly not being escaped correctly in the request url. I've submitted a ticket to MS support.
Nov 25 2022 04:34 PM
SolutionAs a test, I doubled the single apostrophe and the api call does work in that case, so should be simple enough to fix I would think.
Dec 22 2022 08:15 AM - edited Dec 22 2022 08:18 AM
Correct!!! This call fails when the userName has " ' ". Below you can automatically add extra single quote when before the existing one when using ensureUser endpoint
if(userName.search("'") >= 0) {
userName = userName.replace("'", "''");
}