Montag, 9. Juli 2012

Working with different Content Types in a SharePoint List containing Managed Metadata fields

I have a list which contains different Content Types. For each Content Type a “NewForm” is generates with SharePoint Designer.
This is because users should be able to create new entries for the different Content Types not only direct from the NewItem Ribbon Control. Users should create new entries via a Hyperlink.
The different Content Types contains Managed Metadata fields. For example the Content Type “Request”:
If you now try to create a new entry in the list based on a NewForm only the Managed Metadata fields contained in the Content Type which is set as “default” will work. If you have a Content Type within you NewForm which is not in the “default” ones you get the error message: Failed to get value of the "%FiledName%" column from the "Managed Metadata" field type control. See details in log. Exception message: Invalid field name.
But that’s not the only problem. Using for example the call: https://...../Support/Lists/Tickets/NewRequest.aspx  to create a new entry in the Tickets list based on the Content Type “Request” will generate an entry based on the Content Type which is set as default. In my case the system Content Type “Item”.
Both problems can easy be fixed by adding the Content Type ID to the URL call.
For example: https://...../Support/Lists/Tickets/NewRequest.aspx?ContentTypeId=0x0100025CC8C68E63EA4988F262B62EFD206804002A9070F736D1F94F982F921ABB30B4F1

Keine Kommentare:

Kommentar veröffentlichen