Fácil e rápida: Determinar Nome da Columna Interna de unha columna de páxina

Actualización: Jeremy Thake ten un blog sobre iso e poñer-se algúns código para unha aplicación de consola que mostra os nomes internos.

I was trying to get a content query web part to display a due date from a task and because the screen label is "Due Date", I asumido que o nome da columna para usar en <CommonViewFields> is "Due_x0020_Date".

Mal!

The real column name in this case was "DueDate".

Como é que eu atopalo? I re-read Heather Blog de Salomón sobre a modificación CQWP to show additional columns of data. She describes this process at step #13. Trust it. It’s correct. Polo menos, it was correct for me. I did not trust it at first for another column with a much longer name.

I say "Trust it" because I did not trust it and probably wasted near two hours butting my head up against a wall. After I resolved the "DueDate" nome, Quería engadir outro campo de <CommonViewFields>. Using the Solomon technique, I was getting a column name like "XYZ_x0020_Project_x0020_Due_x00".

Eu penso para min mesmo, that’s clearly a truncated name. I went ahead and un-truncated it with no success. I finally used the seemingly truncated name and it worked.

Consello extra: Cando estaba a traballar co CQWP, se eu engade un nome interno malo <CommonViewFields>, the CQWP would tell me that the query had returned no results. Pero, se eu engade un tipo de datos para o nome do campo, it would return a result. Adding the data type actually masked a problem since I was referencing a non-existent field. I could add it, pero cando intento amosar o seu valor, I would always get a blank.

Isto non mascarou o erro:

<CommonViewFields>Due_x0020_Date;</CommonViewFields>

Este fixo enmascarar o erro:

<CommonViewFields>Due_x0020_Date,Datetime;</CommonViewFields>

</final>

3 pensamentos sobre "Fácil e rápida: Determinar Nome da Columna Interna de unha columna de páxina

  1. Corey
    Using the "hover" technique isn’t too bad for one or two fields. But for massive lookups I use the Stramit Caml viewer ligazón. I actually like that one better than the U2U one — é moi rápido e ten a característica interesante de devolver o CAML como código StringBuilder.
    Responder

Deixe unha resposta Paul Galvin cancelar resposta

Enderezo de correo electrónico non será publicado. Os campos obrigatorios están marcados *