June 13, 2013

Datasheet view error 0x80070057

Problem:
This error occurs when you try to ​edit People OR Group field in datasheet view.
Root cause:
Due to inappropriate declaration of site column \ column in list definition this error occurs
Solution:
   1:  $field = $newSite.RootWeb.Lists["ListName"].Fields.GetFieldByInternalName("FieldName")
   2:  $field.SchemaXml = $field.SchemaXml.Replace("<Field", "<Field List=""UserInfo"" ")
   3:  $field.Update()

If you have any questions you can reach out our SharePoint Consulting team here.

Export any web part any where in the site

http://server/_vti_bin/exportwp.aspx?pageurl=absolutePageUrl&guidstring=webPartGuid​
If you have any questions you can reach out our SharePoint Consulting team here.

Problem with ItemUpdated Event Reciever and Rename Document

While performing any actions in itemUpdated() event reciever, care should be taken how SPListitem is accessed.
Changed item is generally accessed as follows:
SPListItem item = web.GetListItem(properties.ListItem.Url);
It will work fine as long as any modification to document name is not made. But when a document is renamed, accessing listitem as above will throw an Exception of Nativestack.
Reason: ItemUpdated() is asynchronous event. Hence, it is not necessary when code executes, new URl is available.
Instead, access the changes Listitem as follows,
properties.Web.Lists[].GetItemById(properties.ListItemId);

If you have any questions you can reach out our SharePoint Consulting team here.