Monday, August 29, 2011

User cannot be found. at Microsoft.SharePoint.SPUserCollection.get_item(String loginName)


Recently during SharePoint upgrade to SP 2010 we have removed the groups (SharePoint groups and AD groups) in SharePoint, but still the K2 Blackpearl Workflows work with SP 2007 only. So the point of removing the groups was to restrict the users to access other sites with in the site collection and allow access to only specific workflows. so we have added the required access to the users for that site. But when workflows were submitted and while adding the data to the SharePoint list items the workflows got into error state with the message “User cannot be found. at Microsoft.SharePoint.SPUserCollection.get_item(String loginName)”.

Here is the screenshot of those errors:
Actually this workflow will create a list item in the SharePoint List which has some columns with the type of People or Group. So while filling the data into these columns with login names the error is thrown by the workflow. After a call with K2 team we have found that if we add these users for any SharePoint group in that site collection it will work. And we could repair all the errors by adding the users to a group with ‘Contribute without delete’ access. I think it may also work with other permissions levels like read-only.
There may be other causes for this error, but this fixed our workflow errors.
So the bottom line is all the users need to belong to atleast a SharePoint group to be accessed by Blackpearl workflow to fill the People or Group type columns in SharePoint list.

K2.Net 2003: Request failed with HTTP status 401: Unauthorized


As we know there are many steps need top be followed to setup the K2.Net 2003. Each step it has its own importance.If we miss any step in configuration we get a specific error for that. Recently we have tried to move the SharePoint List to a new site collection and updated this URL in string table and submit the workflow. So while creating a new list item the workflow got into error state and the error reads like below (below image). We have given Full Permissions on the site and the list, but none of these things worked. Finally after doing this and that I have found that the service account is not listed under site collection administrators. So I have added the account there and tried to repair and it worked so fine. Thought this will help others. So shared here!
So just you know, the steps required for adding the permissions under site collection:
1. Go to Site Actions
2. Select Modify Site Settings
3. Go to site collection Administration
4. Select Top level Settings (if you see this link under that)
5. Next page, under Users and Permissions section click Site collection administrator
6. The next page will show you the Editor showing people picker (check names image and browse)
7. Add the service account into that.


Hope it helps!!!

Access to XMLHttpRequest at 'from origin has been blocked by CORS policy: Cross origin requests are only supported for protocol schemes: http, data, chrome, chrome-extension, https. .net core angular

Issue: The angular application was getting error from API that the origin has been blocked by CORS policy. Solution: Make sure that the...