Control SharePoint to MS Project column mappings when synced from external Project file

StackOverflow https://stackoverflow.com/questions/17412919

  •  02-06-2022
  •  | 
  •  

Pregunta

I'm syncing an external Project file to a SharePoint list. This list was created by a third-party. When I sync the file, there are a set of column mappings that appear inside the Project file. Some of these columns are custom columns created by the third-party (so I'm not talking about just standard SharePoint columns).

Does anyone know how this is done? I've looked at the site column definitions and I don't see anything special that would indicate Project column mappings. I would like to add additional columns and have them appear automatically in the Project file as well (the Project file is generated by Team Foundation Server), and would like to mimic what they have done for forward-compatibility purposes.

I've put out a question to the vendor, but thought I would post a question here in hopes of getting a faster response (assuming they are using something out-of-the-box and that they didn't hack this solution together).

¿Fue útil?

Solución

I figured it out.

You can get the field mapping using the following code (where list is the SPList that represents your task list):

list.RootFolder.Properties["WSSSyncFieldMap"];

If a project file has been synced with the list previously, then the above will return an XML fragment (not a full document) that describes the field mappings. If no such sync has been done, then the property will not exist!

If you open Project and view the mappings, you will see some are not allowed to be changed. These mappings are always assumed by SharePoint and they will not appear in the XML fragment.

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top