Category Archives: שאַרעפּאָינט דעוועלאָפּמענט

פּשוט עקספּלאַנאַטיאָן: “ווערט טוט נישט פאַלן ין דער געריכט קייט.”

דערהייַנטיקן: An anonymous poster left a great comment about internal names. Be sure to read it.

ווען ארבעטן מיט געשעעניש ראַסיווערז און אנדערע קאָד וואָס באַווייַזן שאַרעפּאָינט רשימה זאכן דורך דער כייפעץ מאָדעל, איך אָפֿט מאַכן מיסטייקס אַז דזשענערייט דעם טעות בייַ רונטימע:

טעות Loading און פליסנדיק געשעעניש ופנעמער קאָנטשאַנגאָ.קסיזזיעווענטרעסעיווער אין קסיזזי, ווערסיע = 1.0.0.0, קולטור = נייטראַל, פּובליקקייטאָקען = 0דק50אַ750396ק3אַק. Additional information is below. : Value does not fall within the expected range.

I think this is a fairly generic error that is potentially caused many different ways. אָבער, one simple explanation is that I’m referencing a field incorrectly. If the name of the field is "Due Date", איך מוזן דערמאָנען עס ווי דעם אין אַ געשעעניש ופנעמער:

פּראָפּערטיעס.ליסטיטעם["Due Date"]

ווען איך מיספּעל אָדער נוצן דעם אומרעכט פאַל ווען רעפראַנסינג די פעלד, SharePoint generates the above mentioned runtime error. לעמאָשל, דאָס איז פאַלש:

פּראָפּערטיעס.ליסטיטעם["due Date"]

</עק>

אַבאָנירן צו מיין בלאָג.

טעטשנאָראַטי טאַגס:

שנעל & גרינג: שאַפֿן אַ פאָלדער און באַשטימען אַ אינהאַלט טיפּ (אָדער, האָבן אייער קפּיס און עסן זיי טו)

אין סדר צו אַרבעטן אַרום אַ קפּי פּראָבלעם איך געשריבן וועגן דאָ, I did some testing and discovered that KPI’s work against folders with meta data in the same way that they work against documents or list items. I proved it out by creating a new content type based on the folder content type and then added a few fields. I created some indicators and proved to myself that KPIs work as expected. This was welcome news. It’s not perfect, because the drill-down you get from the KPI against the folders is not exactly what you want. This isn’t too much a drawback in my case because 1) דער סוף ניצערס טאָן נישט וויסן קיין בעסער און 2) the drill-down goes to a folder. They click the folder name and they are at the item. It’s two clicks instead of one, which isn’t the end of the world.

This flowed nicely with the work I was doing. I am creating a folder for every document that gets uploaded. This is done via an event receiver. ווי אַ רעזולטאַט, it’s a piece of cake to keep the parent folder’s meta data in sync with the KPI-driven meta data from the file itself since the plumbing is already in place. דאָס אַלאַוז מיר צו האָבן מיין קפּי ס און זיי אויך עסן 🙂

I modified the event receiver to add the folder and then set this new folder’s content type to my custom KPI-friendly content type. This bit of code did the trick:

 SPFolderCollection srcFolders = targetWeb.GetFolder("Documents").SubFolders;
  ספּפאָלדער addedFolder = srcFolders.Add(properties.ListItem.ID.ToString());
  SPContentTypeId kpiCT = נייַ SPContentTypeId("0x0120002A666CAA9176DC4AA8CBAA9DC6B4039F");
  addedFolder.Item["Content Type ID"] = kpiCT;
  addedFolder.Item.Update();

To locate the actual Content Type ID, I accessed that content type via site settings and copy/pasted it from the URL as shown:

בילד

</עק>

אַבאָנירן צו מיין בלאָג!

שנעל און יזי: באַקומען די ספּפאָלדער פון אַ ספּליסטיטעם אין אַ געשעעניש ריסיווער

איך האַס צו אַרייַנלאָזן עס, but I struggled with this one all day. My event receiver needs to update a field of its parent folder. This little bit shows how to do it:

פּריוואַט פּאָסל ופּדאַטעפּאַרענטפאָלדער(ספּיטעמעווענטפּראָפּערטיעס פּראָפּערטיעס)
{

ספּפאָלדער thisItemFolder = properties.ListItem.File.ParentFolder;
טהיסיטעמפאָלדער.יטעם["ZZ Approval Status"] = "Good news, יעדער יינער!";
טהיסיטעמפאָלדער.יטעמ.ופּדאַטע();


} // ופּדאַטעפּאַרענטפאָלדער

אין דעם פאַל, I’m working with a document library and the properties are coming from an ItemAdded event.

The trick is that you can’t get the SPFolder of the item directly from the item itself (י.ע. properties.ListItem.Folder is null). אַנשטאָט, go to the list item’s associated File and get the File’s folder.

</עק>

אַבאָנירן צו מיין בלאָג!

טעטשנאָראַטי טאַגס:

נאָך אן אנדער געשעעניש ריסיווער דעבוג טריק

I’m sure I’m not the first person to come up with this. אָבער, I haven’t noticed anyone publish a trick like this since I started paying close attention to the community last July. אַזוי, איך געדאַנק איך 'ד פּאָסטן עס דעם שנעל און גרינג דיבאַג שפּיץ.

I’m working on an event receiver that started to generate this error in the 12 כייוו:

טעות Loading און פליסנדיק געשעעניש ופנעמער קאָנטשאַנגאָ.קסיזזיעווענטרעסעיווער אין קסיזזי, ווערסיע = 1.0.0.0, קולטור = נייטראַל, PublicKeyToken=blahbalhbalh. Additional information is below. : כייפעץ דערמאָנען נישט שטעלן צו אַ בייַשפּיל פון אַ כייפעץ.

I didn’t know where I had introduced this bug because I had done too many things in one of my code/deploy/test cycles.

I tried this solution to get my pdb in there with hopes that SharePoint’s 12 hive would show the stack trace, but no luck. I don’t know if it’s possible and if someone does, please let me know 🙂

I know it’s possible to write your own log messages to the 12 כייוו. Frankly, I wanted something a little less scary and quicker to implement.

עס פארגעקומען צו מיר אַז איך קען לפּחות באַקומען עטלעכע גרונט שפּור אינפֿאָרמאַציע דורך קאַטשינג און שייַעך-פארווארפן דזשאַנעריק אויסנעמען ווי דעם:

  פּרובירן {
    ופּדאַטעעדיטיאָנדאַטע(פּראָפּערטיעס);
  }
  כאַפּן (ויסנעם און)
  {
    וואַרפן נייַ ויסנעם("Dispatcher, ופּדאַטעעדיטיאָנדאַטע(): ויסנעם: [" + ע.טאָסטרינג() + "].");
  }

דאס אנטפלעקט זיך אין די 12 כייוו דאַסלי:

טעות Loading און פליסנדיק געשעעניש ופנעמער קאָנטשאַנגאָ.קסיזזיעווענטרעסעיווער אין קסיזזי, ווערסיע = 1.0.0.0, קולטור = נייטראַל, פּובליקקייטאָקען = בלאַהבלאַהבלאַה. Additional information is below. : דיספּאַטטשער, ופּדאַטעעדיטיאָנדאַטע(): ויסנעם: [סיסטעמ.נוללרעפערענסעעקססעפּטיאָן: כייפעץ דערמאָנען נישט שטעלן צו אַ בייַשפּיל פון אַ כייפעץ. at Conchango.xyzzyManagementEventReceiver.UpdateEditionDate(ספּיטעמעווענטפּראָפּערטיעס פּראָפּערטיעס) at Conchango.xyzzyManagementEventReceiver.Dispatcher(ספּיטעמעווענטפּראָפּערטיעס פּראָפּערטיעס, שטריקל עווענטדעסקריפּטיאָן)].

וואָס האט מיר אַלע די דעטאַל איך דארף צו שפּור אַראָפּ אַז באַזונדער פּראָבלעם און איך דערוואַרטן צו נוצן עס אַ פּלאַץ געגאנגען פאָרויס.

</עק>

אַבאָנירן צו מיין בלאָג!

באַשייד: ספּקווערי טוט ניט זוך פאָלדערס

This past week I was implementing an "evolving" solution for a client that uses BDC and SPQuery and ran into some difficulty using SPQuery against a document library containing folders. דנאָ שורה: assign "recursive" to the view attribute of the query.

My scenario:

  • On Monday, I upload a document and supply some meta data.
  • The following week, I upload a new document. Much of this new document’s meta data is based on the document I uploaded on Monday (which we call the "master document").
  • We’ve created a web service façade that provides a BDC-friendly interface to the list so that users can easily locate that Monday document via a title search.
  • A BDC data column provides a friendly user interface. (This is part of my attempt at using BDC for a more friendly Lookup column).

The final BDC façade service uses a query like this to do the lookup:

 // Used U2U tool to assist in generating this CAML query.
      oQuery.Query =
        "<ווו>";

      צי (titleFilter.Length > 0)
        oQuery.Query  =
          "  <און>";

      oQuery.Query  =
        "    <און>" +
        "      <Geq>" +
        "        <FieldRef Name=\"DocumentId\" />" +
        "        <Value Type=\"Text\">" + minId + "</ווערט>" +
        "      </Geq>" +
        "      <Leq>" +
        "        <FieldRef Name=\"DocumentId\" />" +
        "        <Value Type=\"Text\">" + maxId + "</ווערט>" +
        "      </Leq>" +
        "    </און>";

      צי (titleFilter.Length > 0)
        oQuery.Query  =
          "    <כּולל>" +
          "      <FieldRef Name=\"Title\" />" +
          "      <Value Type=\"Text\">" + titleFilter + "</ווערט>" +
          "    </כּולל>" +
          "  </און>";
      oQuery.Query  =
        "</ווו>";

During the initial stage of development, this worked great. אָבער, we introduced folders into the directory to solve some problems and suddenly, my BDC picker wouldn’t return any results. I tracked this down to the fact that the SPQuery would never return any results. We used folders primarily to allow multiple files with the same name to be uploaded but with different meta data. When the file is uploaded, we create a folder based on the list item’s ID and then move the file there (I wrote about that דאָ; we’ve had mixed results with this approach but on the whole, it’s working well). The user don’t care about folders and in fact, don’t really understand that there are any folders. We have configured all the views on the library to show items without regard to folders.

I hit this problem twice as the technical implementation evolved and solved it differently each time. The first time, I wasn’t using the CONTAINS operator in the query. Without a CONTAINS operator, I was able to solve the problem by specifying the view on the SPQuery’s contructor. Instead of using the default constructor:

ספּליסט oList = web.Lists["Documents"];

SPQuery oQuery = נייַ SPQuery();

I instead used a constructor that specified a view:

ספּליסט oList = web.Lists["Documents"];

SPQuery oQuery = נייַ SPQuery(oList.Views["All Documents"]);

That solved the problem and I started to get my results.

I then added the CONTAINS operator into the mix and it broke again. It turns out that the CONTAINS operator, so far as I can tell, does not work with the view the same way as the a simpler GEQ / LEQ operators. I did some searching and learned that the query’s ViewAttributes should be set to "Recursive", ווי אין:

oQuery.ViewAttributes = "Scope=\"Recursive\"";

That solved the problem for CONTAINS. אין פאַקט, this also solved my original search problem and if I had specified the recursive attribute the first time, I would not have run into the issue again.

The fact that a view-based SPQuery works for some operators (GEQ/LEQ) and not others (CONTAINS), coupled with the fact that KPIs don’t seem to work at all with folder-containing document libraries leads me to believe that SPQuery has some orthogonality issues.

Special Thanks:

  • The good folks at U2U and their query tool.
  • Michael Hoffer’s great "learning by doing" בלאָג פּאָסטן, comments and responses.

</עק>

אַבאָנירן צו מיין בלאָג!

מאָך קפּי זשוק? רשימה ינדיקאַטאָר טייד צו דאָקומענט ביבליאָטעק מיט פאָלדערס

דערהייַנטיקן 02/29/08: I solved this problem by creating a folder and then assigning a content type to the folder which has the meta data I need for the KPIs. איך דיסקרייבד אַז אין אַ קליין מער דעטאַל דאָ.

We have implemented a technical solution where users upload documents to a document library. An event receiver creates a directory and moves the file to that directory (ניצן אַ טעכניק ענלעך צו וואָס איך געשריבן וועגן דאָ). We’ve successfully navigated around the potential issues caused by event receivers that rename uploaded files (mainly because users never start their document by clicking on "New" אָבער אַנשטאָט מאַכן די דאָקס לאָוקאַלי און דעמאָלט צופֿעליקער זיי).

The meta data for these documents includes a Yes/No site column called "Urgent" and another site column called "Status". We need to meet a business requirement that shows the percentage of "Urgent" documents whose status is "Pending".

דאס איז יוזשאַוואַלי פּשוט צו טאָן און איך דיסקרייבד עפּעס זייער פיל ווי דאָס בייַ די שאַרעפּאָינט בעאַגלע מיט גורל פון פאַרשטעלן שאַץ אויב איר ניטאָ אינטערעסירט.

אין אַ נאַטשעל, איך האט די פאלגענדע:

  • Create a view on the doc library called "Pending".
  • קאַנפיגיער די מיינונג צו איגנאָרירן טעקע סטרוקטור.
  • שאַפֿן אַ קפּי רשימה.
  • Create an indicator in the list that points to the doc lib and that "Pending" מיינונג.

This simply does not work. The KPI shows my target (e.g. פינף דרינגלעך דאָקומענטן) but always shows the actual number of urgent documents as zero. Paradoxically, אויב איר בויער אַראָפּ צו די פרטים, it shows the five urgent documents in the list. I created a very simple scenario with two documents, one in a folder and one not. Here is the screen shot:

בילד

The above screen shot clearly shows there are two documents in the view but the "value" is one. The "CamlSchema" with blank document Id is in the root folder and the other is in a folder named "84".

עס אויס צו מיר אַז אַפֿילו כאָטש איר ספּעציפיצירן אַ מיינונג, the KPI doesn’t honor the "show all items without folders" באַשטעטיקן און אַנשטאָט, קאַנפיינז זיך צו דער וואָרצל טעקע.

אויב איך בין אומרעכט, ביטע פאַלן מיר אַ שורה אָדער לאָזן אַ באַמערקונג.

</עק>

אַבאָנירן צו מיין בלאָג!

טעטשנאָראַטי טאַגס:

לייזונג צו פּראָבלעם: “פילענאָטפאָונדעקססעפּטיאָן” מיט מייַן שטריך ריסיווער.

I was working on a feature last week that would add some event receivers to a specific list instance. (איך בלאָגגעד אַ ביסל וועגן וואָס רשימה ופנעמער דאָ).

ניצן דעם באַפֿעל שורה, איך קען ינסטאַלירן דער שטריך מיט קיין טעות (אָבער זען ווייטער פֿאַר די פאַרבאָרגן טעות). When I tried to deploy the feature on the site, MOSS complained of a "FileNotFoundException" גרייַז. This blog entry describes how I solved it.

This is the error that MOSS showed me in the web browser:

Feature ‘b2cb42e3-4f0a-4380-aaba-1ef9cd526f20’ could not be installed because the loading of event receiver assembly "xyzzyFeatureReceiver_0" failed: סיסטעמ.יאָ.פילענאָטפאָונדעקססעפּטיאָן: Could not load file or assembly ‘xyzzyFeatureReceiver_0’ or one of its dependencies. The system cannot find the file specified.
File name: ‘xyzzyFeatureReceiver_0’
at System.Reflection.Assembly.nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, Assembly locationHint, StackCrawlMark& stackMark, Boolean throwOnFileNotFound, Boolean forIntrospection)
at System.Reflection.Assembly.InternalLoad(AssemblyName assemblyRef, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection)
at System.Reflection.Assembly.InternalLoad(String assemblyString, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection)
at System.Reflection.Assembly.Load(String assemblyString)
at Microsoft.SharePoint.Administration.SPFeatureDefinition.get_ReceiverObject()
WRN: Assembly binding logging is turned OFF.
To enable assembly bind failure logging, set the registry value [HKLM\Software\Microsoft\Fusion!EnableLog] (DWORD) צו 1.
טאָן: There is some performance penalty associated with assembly bind failure logging.
To turn this feature off, remove the registry value [HKLM\Software\Microsoft\Fusion!EnableLog].

Troubleshoot issues with Windows SharePoint Services.

I know how to deliberately cause that error: don’t install the assembly in the GAC. אָבער, it was in the GAC. I normally install assemblies into the GAC by dragging them into the c:\windows\assembly folder using windows explorer. I’ve never felt 100% comfortable doing that because I always thought that gacutil existed for a reason … so I tried that. It made no difference.

I searched the Internets and found this post: http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=2243677&SiteID=1

The poster happened to be using the same root bit of code (from the Inside WSS book from this list) so that was a hopeful sign. אָבער, the suggestion of decorating the assembly with an [assembly: ] directive didn’t make sense to me. I tried it anyway and I was right. It made no difference.

Then I noticed that my class definition was not public. I made it public and that made no difference.

ווייַטער, I went to the trouble of enabling the "assembly bind failure log" (following the helpful and accurate instructions provided) and this is where things started to get interesting. That log shows me that the runtime is searching everywhere on that server for my assembly. It even appears to be searching for it in my medicine cabinet. אָבער … it won’t search for it in the GAC.

I put on my winter jacket and go searching the Internets again and find that someone has had this problem too. The lengthy discussion in that posting peters off into nothing and I can’t find a solution.

I move my assembly into one of the places the log claims it’s searching and I make a little more progress. I’m rewarded with a new error in the browser when I try to activate the feature:

Failed to create feature receiver object from assembly "xyzzyFeatureReceiver_0", type "Conchango.xyzzyFeatureReceiver" for feature b2cb42e3-4f0a-4380-aaba-1ef9cd526f20: System.ArgumentNullException: ווערט קענען ניט זיין נאַל.
פּאַראַמעטער נאָמען: טיפּ
at System.Activator.CreateInstance(Type type, Boolean nonPublic)
at System.Activator.CreateInstance(Type type)
at Microsoft.SharePoint.Administration.SPFeatureDefinition.get_ReceiverObject()

Troubleshoot issues with Windows SharePoint Services.

Time for one last trip to the Internets!

This time I find out, predictably enough, that MOSS issues this error because the assembly is not in GAC.

I want to get something positive out of this and try to feel a little proud that I’ve created the Fugitive of MSIL assemblies, but it’s not working. I’m just plain annoyed. I find myself muttering "chicken or the egg" under my breath.

I finally decide to punt. I create an entirely new project and copy/paste the code from the incredible-cloaked-from-the-GAC-assembly non-working project over to this new project. (I look for a build flag called something like "hide from assembly binding if installed in the GAC" but can’t find one).

I install the feature and activate it and … it works! אַזוי, after all that, I had to basically ‘reboot’ my project. This is another reason why I hate computers.

I did learn something useful from this. I had been installing features using the stsadm command line all day long and been using the "-force" option out of habit. פֿאַר עטלעכע סיבה, I did not use the -force option when I installed the new project. דאס מאָל, I did actually, truly forget to copy this new project’s assembly into the GAC. ווי אַ רעזולטאַט, I received that "FielNotFoundException" גרייַז. דאס מאָל, I got it from stsadm, not when I tried to activate the feature via the web browser. אַזוי, -force actually plays two roles. It allows you to re-install an existing feature. It also allows you to install a buggy feature that cannot work at runtime by suppressing the error. It probably says as much in the help somewhere but I never noticed it.

</עק>

שנעל & גרינג: רענאַמע ופּלאָאַדעד טעקע ניצן שאַרעפּאָינט אָבדזשעקט מאָדעל וויאַ אַן עווענט ריסיווער

דערהייַנטיקן: This works but there are significant limitations which are described in the comments. This may still be useful in some cirumstances.

דערהייַנטיקן 2: אין מיין קראַנט פּרויעקט, users always upload documents. ווי אַ רעזולטאַט, I don’t run into a problem where MS Word is running and thinks that the file was renamed on it. I did run into a problem, "the file was modified by someone else" and solved this via a simple semaphore type flag. Users need to change a meta data field from its default value to something else. The itemupdated() ופנעמער קוקט פֿאַר אַ גילטיק ווערט עס איידער פאקטיש פּערפאָרמינג די רענאַמע און זינט דעמאָלט, I have not had any problems. Your mileage may vary.

I have a client requirement to change the name of files uploaded to a specific document library to conform with a particular naming convention. The API does not provide a "rename()" מעטאָד. אַנשטאָט, מיר נוצן "MoveTo(…)". Here is a minimal bit of code to accomplish this:

 עפנטלעך אָווועררייד פּאָסל יטעמאַדדעד(ספּיטעמעווענטפּראָפּערטיעס פּראָפּערטיעס)
        {
            ספּפילע F = פּראָפּערטיעס.ליסטיטעמ.פילע;

            פ.מאָוועטאָ(פּראָפּערטיעס.ליסטיטעמ.פּאַרענטליסט.ראָאָטפאָלדער.ורל + "/xyzzy.doc");
            פ.ופּדאַטע();

        }

The only tricky bit is the "properties.ListItem.ParentList.RootFolder.Url". The MoveTo() method requires a URL. That mashed up string points me to the root folder of my current document library. This allows me to avoid any hard coding in my event receiver.

דאס איז אַ מער נוצלעך ווערסיע וואָס טוט די זעלבע זאַך, but assigns the name of the file to "Title":

 עפנטלעך אָווועררייד פּאָסל יטעמאַדדעד(ספּיטעמעווענטפּראָפּערטיעס פּראָפּערטיעס)
        {
            דיסאַבלעעווענטפירינג();

            // באַשטימען די טיטל פון דעם נומער צו דעם נאָמען פון טעקע זיך.
 // נאָטיץ: דאס אַסיינמאַנט מוזן נעמען אָרט איידער מיר מאָדיפיצירן דער טעקע זיך.
 // פאַך דערהייַנטיקן() אויף די ספּפילע מיינט צו ינוואַלידייט די פּראָפּערטיעס אין
 // עטלעכע זינען.  Updates to "Title" ניט אַנדערש ביז אַז ענדערונג (און דערהייַנטיקן() רופן)
 // זענען אריבערגעפארן אין פראָנט פון די טוישן צו דער טעקע נאָמען.
            פּראָפּערטיעס.ליסטיטעם["Title"] = Properties.ListItem.File.Name;

            פּראָפּערטיעס.ליסטיטעמ.ופּדאַטע();

            ספּפילע F = פּראָפּערטיעס.ליסטיטעמ.פילע;

            // באַקומען די פאַרלענגערונג פון דער טעקע.  מיר דאַרפֿן אַז שפּעטער.
 שטריקל ספּפילעעקסט = נייַ טעקע אינפֿאָרמאַציע(f.Name).געשפּרייט;

            // רענאַמע דער טעקע צו די רשימה נומער ס שייַן און נוצן די טעקע געשפּרייט צו האַלטן
 // אַז טייל פון עס בעשאָלעם.
            פ.מאָוועטאָ(פּראָפּערטיעס.ליסטיטעמ.פּאַרענטליסט.ראָאָטפאָלדער.ורל +
                "/" + פּראָפּערטיעס.ליסטיטעם["ID"] + ספּפילעעקסט);

            // טוען די רירן.
            פ.ופּדאַטע();

            ענאַבלעעווענטפירינג();
        }

שנעל טיפּ: אינהאַלט קווערי וועב חלק, לאָאָקופּ קאַלאַם ווערט און קססל

I have a column name in a content type named "Real Estate Location".

That column is of type "lookup".

איך האָבן מאַדאַפייד <קאָממאָנוויעוופיעלדס> און יטעמסטילע.קססל צו ווייַזן דעם זייַל.

א פּשוט <קססל:ווערט-פון אויסקלייַבן =…> קערט צוריק אַן ינערלעך ווערט אַז כולל אָרדינאַל שטעלע דאַטן, אַזאַ ווי:

1;#מיאַמי

צו באַקומען דעם מענטש-פרייַנדלעך ווערט, ניצן קססל סובסטרינג-נאָך, ווי געוויזן:

<קססל:value-of select="substring-after(@ רעאַל_קס005פ_קס0020_עסטאַטע_קס005פ_קס0020_לאָקאַטיאָן,'#')"></קססל:ווערט-פון>

ניצן דעם טעכניק ווען איר זענט ארבעטן מיט לאָאָקופּ וואַלועס אין קססל טראַנספאָרמז און דאַרפֿן צו באַקומען דעם מענטש-פרייַנדלעך ווערט.

<סוף />

טעטשנאָראַטי טאַגס: , ,

שנעל און יזי: באַשטימען אינערלעכער קאַלאַם נעמען פון אַ וועבזייַטל קאַלאַם

דערהייַנטיקן: דזשערעמי טהאַקע האט בלאָגגעד וועגן דעם און לייגן אַרויף עטלעכע קאָד פֿאַר אַ קאַנסאָול אַפּלאַקיישאַן וואָס ווייזט ינערלעך נעמען.

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", איך אנגענומען אַז דער זייַל נאָמען צו נוצן אין <קאָממאָנוויעוופיעלדס> is "Due_x0020_Date".

פאַלש!

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

ווי האט איך געפינען עס? I re-read Heather שלמה ס בלאָג פּאָזיציע אויף מאַדאַפייינג קקוופּ to show additional columns of data. She describes this process at step #13. Trust it. It’s correct. אין מינדסטער, 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" נאָמען, איך געוואלט צו לייגן אן אנדער פעלד צו <קאָממאָנוויעוופיעלדס>. Using the Solomon technique, I was getting a column name like "XYZ_x0020_Project_x0020_Due_x00".

איך געדאַנק צו זיך, 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.

באָנוס שפּיץ: ווען איך איז געווען ארבעטן מיט די קקוופּ, אויב איך צוגעלייגט אַ שלעכט ינערלעך נאָמען צו <קאָממאָנוויעוופיעלדס>, the CQWP would tell me that the query had returned no results. אָבער, אויב איך צוגעלייגט אַ דאַטן טיפּ צו די פעלד נאָמען, 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, אָבער ווען איך געפרוווט צו אַרויסווייַזן זייַן ווערט, I would always get a blank.

דאס האט נישט מאַסקע דער טעות:

<קאָממאָנוויעוופיעלדס>דוע_קס0020_דאַטע;</קאָממאָנוויעוופיעלדס>

דאס האט מאַסקע דער טעות:

<קאָממאָנוויעוופיעלדס>דוע_קס0020_דאַטע,דאַטעטימע;</קאָממאָנוויעוופיעלדס>

</עק>