Search code examples
sharepoint-2007

SharePoint: Field value different when editing than when displayed


When I look at a certain field, either via DispForm (individual item) or any view of the list, I see a certain value. But when I choose to edit that field, the value shown to be in effect is different from what I see in any view.

This happens sometimes--too often to be comfortable.

I cannot even imagine how this can happen. Any ideas?

Here is a row from, say, AllItems: enter image description here

And here is that row in edit mode: enter image description here


Solution

  • Here's how the situation described in my original posting has worked out.

    As Ondreij asked, the field in question is a Choice field. A status field is provided in the email sent to SharePoint, and I use that value to populate the field in question.

    What appears to have happened is that sometimes the string got written to some part of the list. When you checked the value of field after that writing (using the Edit facility), I found that the "real" value had not changed from the default "0".

    There were a couple problems. In one case, someone had listed one of the Choice values as "...BC..." where the original status string uses "...Bureau Coordinator..." That one was easy. Another case has "...To..." in the Choice strings where the status value is passed as "...to..." That was sneakier.

    But the big surprise was status 4, where none of us can tell any difference between the status value and the Choice value. But there must be a difference, because as the following code shows, replacing the status string with the Choice string allows everything to complete as designed.

    if(status.indexOf("2 - Sent") > -1) status = "2 - Sent To BC";

    if(status.indexOf("3 - Sent") > -1) status = "3 - Sent To GFSS";

    if(status.indexOf("4 - Accepted") > -1) status = "4 - Accepted by GFSS";

    Thanks, Ondreij, for some thoughts that led to a solution.