UPDATE: Jeremy Thake blog oor en sit 'n paar kode vir 'n konsole aansoek wat interne name toon.
Ek het probeer om 'n inhoud navraag web deel te kry om 'n vervaldatum van 'n taak om te wys, en omdat die skerm van 'n etiket "vervaldatum", Ek aanvaar dat die kolom naam te gebruik in <CommonViewFields> "Due_x0020_Date".
Verkeerd!
Die werklike kolom naam in hierdie geval was "DueDate".
Hoe het ek dit vind? I re-read Heather Salomo se blog inskrywing op die wysiging van CQWP to show additional columns of data. She describes this process at step #13. Trust it. It’s correct. Ten minste, it was correct for me. I did not trust it at first for another column with a much longer name.
Ek sê "Vertrou dit" because I did not trust it and probably wasted near two hours butting my head up against a wall. After I resolved the "DueDate" naam, Ek wou 'n ander veld toe te voeg tot <CommonViewFields>. Using the Solomon technique, Ek was besig om 'n kolom naam soos "XYZ_x0020_Project_x0020_Due_x00".
Ek het gedink, 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 punt: Wanneer ek besig was met die CQWP, as ek by 'n slegte interne naam <CommonViewFields>, the CQWP would tell me that the query had returned no results. Maar, as ek by 'n datatipe aan die gebied se naam, 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, Maar toe ek probeer het om die waarde daarvan om te wys, I would always get a blank.
Dit het nie masker die fout:
<CommonViewFields>Due_x0020_Date;</CommonViewfields>
Dit het verdoesel die fout:
<CommonViewFields>Due_x0020_Date,Date Time;</CommonViewfields>
</einde>