0

I have created a custom document library in SharePoint 2013 which has a custom content type. This content type, in turn, has a Excel document template (.xlsx). The content type also has a few custom fields (one lookup to another list and two DateTime fields). When I click New Document -> My Content Type in the Ribbon on a machine that has Office 2016 installed, the template opens. When I try to save it, I get a popup with my custom fields to fill up. So everything works as expected. However, when I try to do the same using Office 2010, I get an Exception when Excel tries to load the popup with the custom fields:

The query cannot be run for the following DataObject: list_ӫ
Document Information Panel cannot run the specified query.
The SOAP response indicates that an error occurred on the server:

Exception of type 'Microsoft.SharePoint.SoapServer.SoapServerException' was thrown.
<detail><errorstring xmlns="http://schemas.microsoft.com/sharepoint/soap/">
    List does not exist.
    The page you selected contains a list that does not exist.  It may have been deleted by another user.
    </errorstring><errorcode xmlns="http://schemas.microsoft.com/sharepoint/soap/">0x82000006</errorcode></detail>

Office 2016:

enter image description here

Office 2010:

enter image description here

EDIT: Strangely, when I add a new lookup column through the UI and remove the one I deploy from my farm solution, I get no error and the property popup is loaded. So maybe there's something wrong with my field definition:

<?xml version="1.0" encoding="utf-8"?>
<Elements xmlns="http://schemas.microsoft.com/sharepoint/">  
  <Field
       ID="{af0eaf74-f106-4fce-a1d5-e61f55046d7f}"
       Name="MyCustomLookup"
       Type="Lookup"
       List="Lists/LookupList"
       ShowField="Title"
       DisplayName="My Custom Lookup" 
       Required="TRUE"
       Group="Custom Fields">
  </Field>
</Elements>
0

ok the answer lies in this post: Link

Explanation: We created SharePoint fields by using an XML/Code-based approach. We deployed our fields using xml definition then changed LookupList/LookupWeb properties in code. when we did this, we did not add {} to the List attribute of the SchemaXml property of the field. Apparently, Office 2016 can handle this but not Office 2010. So what we needed to do is add curly brackets to our SchemaXml property like so:

 lookup.SchemaXml = lookup.SchemaXml.Replace(lookup.LookupList, "{" + listId.ToString() + "}");

Instead of so:

 lookup.SchemaXml = lookup.SchemaXml.Replace(lookup.LookupList, listId.ToString());

You can also do this using SharePoint Manager. Just navigate to the field definition of the list fields collection, look into the SchemaXml property and make sure the List attribute has curly brackets around it.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.