Skip Ribbon Commands
Skip to main content

Tanmay Shahane | zevenseas | SharePoint Blog

:

Tanmay Shahane | zevenseas | SharePoint Blog > Posts > Sandbox solution and Taxonomy or Managed metadata field names (Follow up on earlier post)
August 18
Sandbox solution and Taxonomy or Managed metadata field names (Follow up on earlier post)

 

Hello kind readers…
 
Sometime back I posted (Post here) about the Taxonomy fields (Managed metadata columns) and the SPSiteDataQuery in Sandbox solution. Today while working more on that I came across an interesting thing and wanted to share the same with you all so everyone is updated.
 
Well the thing is that in my previous post I talked about how when you add a managed meta data column a hidden note field is added with it and the general convention is that it will always be as the same name as the internal name of the original field but will have TaxHTField0 appended to it, means  if your managed column internal name is city then then the hidden note field internal name would be cityTaxHTField0 and you can then use this to get it in your query results… BUT….
 
There is a catch … not sure if you already know about this but when you have a bit long display name with spaces and special characters like Company process H&R then in SharePoint internal name terms this translates to,
 
Internal name =  Company_x0020_process_00x20_H_00x26_R and the hidden note field internal would be
Company_x0020_process_00x20_H_00x26_RTaxHTField0
 
Ideally this should be the case, which of course is not else why would I be writing here :), so the thing is the column name is fixed to 32 characters only which includes the escape characters like in this case. _ x 0 2 0 these also are included in length.
 
So if case you have a column name where you give a bit long display name check the internal name of the field by regular ways (mostly by right click on column from list settings and check properties) and get the internal name with escaped characters including the _x0020_ and then count the characters in you internal name of the field… if its like 28 characters then the internal name of the hidden field related to that taxonomy column would be
 
Company_x0020_process_00x20_H_00x  only 32 characters will be there. (index starting at 0)
 
So you may get different names based on name of the column .. It could be like
  •  someColumnName...TaxH
  •  someColumnName...TaxHTF
  •  someColumnName...Ta
  •  someColumnName...TaxHFiel
 
It will all depend on the length… so in case you want to reference the hidden notes field to get the data from multi value  taxonomy fields in SPSiteDataQuery for sandbox solution as discussed in the earlier post then this is to be applied their.
 
 
Hope this is helpful and  if you have any queries or comments please feel free to hit me !!! :)
 

       - "T"

Comments

Use Managed metadata col with CAML

unable to use managed metadata column with CAML query.
Using the syntax <FieldRef name="name"><Value Type="TaxonomyFieldType">...

Throws error: The filter cannot be parsed. Check filter syntax, and try again.
 on 12/6/2011 2:53 AM

Get Term Id from Managed metadata field in a sandbox

You can actually get a hidden related managed metadata field via following code:
tem[item.Fields["{You metadata column static name}"].Id.ToString("N")]

More detail in my related post - http://sharing-the-experience.blogspot.com/2012/09/get-term-id-from-managed-metadata-field.html
 on 9/11/2012 2:29 PM

Add Comment

Title


Body *


Attachments

 

 Statistics

 
Views: 1300
Comments: 2
Tags:Taxonomy Columns
Published:643 Days Ago