Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

I've got a webpart which reads several values from a list, while developing local I've got a column "Due Date", but when I upload my webpart to SharePoint online (Office 365) we have a German version and the column is called "Fälligkeitsdatum" so my code doesn't work (without changing the columnname in the source everytime).

How can I read the column independent from language? Is this possible with guid?

share|improve this question
add comment

2 Answers

up vote 1 down vote accepted

Use SPField.InternalName.

You can see what the Internal Name in several ways, such as in List Settings, or in AllItems (url when sorting by a field).

Internal Name of "Due Date" in Tasks list is DueDate.

share|improve this answer
add comment

Yes you should use the GUID

The GUID of a lot of the BuiltIn Fields are abailable in SPBuiltInFieldId regarding Due Date use SPBuiltInFieldId.DueDate

share|improve this answer
    
Could you provide a sample? I can't get it to work: Invalid field name. {c1e86ea6-7603-493c-ab5d-db4bbfe8f96a} –  Aljoscha Husp Sep 28 '12 at 12:41
    
Sounds like you are passing in a GUID as a string and not as a GUID object. You can convert a string to a GUID using Guid fieldId = new Guid(guidAsString); –  ToddersLegrande Sep 28 '12 at 12:47
    
Unfortunatly not :-( SPBuiltInFieldId.DueDate is already a Guid. –  Aljoscha Husp Sep 28 '12 at 12:55
    
Ohhhh sorry the mistake was that I used DueDate, but as I'm using a tasklist I needed to use TaskDueDate. Your code works perfect thanks :-) –  Aljoscha Husp Sep 28 '12 at 13:10
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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