Mabilis at madali: Matukoy ang Panloob na Haligi Pangalan ng isang Haligi ng Site

I-UPDATE: Jeremy Thake Na-blog tungkol sa mga ito at ilagay up ng ilang mga code para sa isang application console na nagpapakita ng panloob na mga pangalan.

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", Ako ipinapalagay na ang Pangalan ng hanay upang gamitin sa <CommonViewFields> is "Due_x0020_Date".

Mali!

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

Paano ko mahanap ito? I re-read Heather Entry sa blog ni Solomon sa pagbabago ng CQWP to show additional columns of data. She describes this process at step #13. Trust it. It’s correct. Kahit, 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" pangalan, Nais kong magdagdag ng isa pang field upang <CommonViewFields>. Using the Solomon technique, I was getting a column name like "XYZ_x0020_Project_x0020_Due_x00".

Akala ko sa sarili ko, 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.

Bonus tip: Kapag ako ay nagtatrabaho kasama ang CQWP, kung ako ay nagdagdag ng isang masamang pangalan ng panloob na <CommonViewFields>, the CQWP would tell me that the query had returned no results. Pero, kung ako ay nagdagdag ng isang uri ng data upang ang pangalan ng field, 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, ngunit kapag sinubukan ko upang ipakita ang halaga nito, I would always get a blank.

Ito ay hindi mask ang error:

<CommonViewFields>Due_x0020_Date;</CommonViewfields>

Ito ang mask ang error:

<CommonViewFields>Due_x0020_Date,DATETIME;</CommonViewfields>

</dulo>

3 ano sa tingin mo "Mabilis at madali: Matukoy ang Panloob na Haligi Pangalan ng isang Haligi ng Site

  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 link. I actually like that one better than the U2U one — ay masyadong mabilis at ito ay nakuha ang magaling na tampok ng bumabalik ang CAML bilang StringBuilder code.
    Sumagot

Mag-iwan ng Sumagot sa Paul Galvin Ikansela reply

Ang iyong email address ay hindi nai-publish. Mga kinakailangang patlang ay minarkahan *