Tapaidh agus éasca: Socraigh Colún Ainm inmheánaigh den Colún tSuímh

Suas chun dáta: Jeremy Thake Tá blogged faoi seo agus chur ar bun roinnt cód le haghaidh iarratas consól go léiríonn ainmneacha inmheánacha.

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", Ghlac mé go raibh an t-ainm colún a úsáid i <CommonViewFields> is "Due_x0020_Date".

Mícheart!

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

Conas a raibh a aimsiú liom é? I re-read Heather Iontráil bhlag Sholamón ar mhodhnú CQWP to show additional columns of data. She describes this process at step #13. Trust it. It’s correct. Ar a laghad, 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" ainm, Theastaigh uaim a réimse eile a chur le <CommonViewFields>. Using the Solomon technique, I was getting a column name like "XYZ_x0020_Project_x0020_Due_x00".

Shíl mé go féin, 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.

Bónas tip: Nuair a bhí mé ag obair leis an CQWP, má chuir mé ainm inmheánach dona <CommonViewFields>, the CQWP would tell me that the query had returned no results. Ach, má chuir mé cineál sonraí chuig an t-ainm réimse, 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, ach nuair a rinne mé a chur ar taispeáint a luach, I would always get a blank.

Ní raibh an masc an earráid:

<CommonViewFields>Due_x0020_Date;</CommonViewfields>

Seo raibh masc an earráid:

<CommonViewFields>Due_x0020_Date,Datetime;</CommonViewfields>

</deireadh>

3 smaointe ar "Tapaidh agus éasca: Socraigh Colún Ainm inmheánaigh den Colún tSuímh

  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 nasc. I actually like that one better than the U2U one — Tá sé an-tapa agus é a fuair an gné deas ag filleadh ar an CAML mar StringBuilder Cód.
    Freagra

Leave a Reply

Ní thabharfar do sheoladh r-phoist a fhoilsiú. Réimsí riachtanacha atá marcáilte *