Var CAML Broken?

Home Forums vLooup for SharePoint Var CAML Broken?

Viewing 13 reply threads
  • Author
    Posts
    • #28991
      Tricia S.
      Participant

        I have a var in the Write your own CAML-query section of the vLookup and its no longer working.

        I testing replacing the the {var:finalCAML} with the Real CAML that my var is building and it worked fine.

        It seems to be calling the function and Building everything correctly but its not using the result and it won’t even use the result if I do:
        var finalCAML = “<Where><In><FieldRef Name=’ID’/><Values><Value Type=’Number’>2</Value><Value Type=’Number’>3</Value></Values></In></Where>”;

        Could the Write your own CAML-query section be broken?

      • #28993
        Alexander Bautz
        Keymaster

          Do you get an error message about an undefined variable, or does it just not work?

          Also note that the variable defined in Custom JS only works for the forms and not if you use vLookup in a list view.

          Alexander

        • #28995
          Tricia S.
          Participant

            The Var in the custom JS seems to be working fine, but the vLookup keeps pulling all when it should only pull the items listed in my var. See image.

            Its like it Can’t tell that the CAML is there so it just pulls everything.

            Attachments:
          • #28998
            Tricia S.
            Participant

              I can have its as simple as
              Custom JS:
              var testCAML = “<Where><In><FieldRef Name=’ID’/><Values><Value Type=’Integer’>1</Value><Value Type=’Integer’>4</Value></Values></In></Where>”;

              with
              Write your own CAML-query:{var:testCAML}

              and it won’t work, It just pulls all Items.

              But if i just do :
              Write your own CAML-query:<Where><In><FieldRef Name=’ID’/><Values><Value Type=’Integer’>1</Value><Value Type=’Integer’>4</Value></Values></In></Where>

              It works fine. It just pulls the ID’s listed.

            • #29000
              Alexander Bautz
              Keymaster

                Ah, I think I know the reason. I made a check that looks for in the Write your own CAML query – and if this is not present, it uses the Query builder instead – and this must run before your variable is processed.

                Try using it like this in your Build your own CAML:

                <Where><In><FieldRef Name='ID'/><Values>{var:myCAML}</Values></In></Where>

                And then add only this to your variable:

                var myCAML = "<Value Type='Integer'>1</Value><Value Type='Integer'>4</Value>";

                Alexander

              • #29002
                Tricia S.
                Participant

                  Now I’m getting an error.

                • #29006
                  Alexander Bautz
                  Keymaster

                    Try adding vLookupDebug=1 to your form URL like this:

                    What does the output show?

                    Alexander

                  • #29008
                    Tricia S.
                    Participant

                      Now we are cooking. Its seems to be not formatting it right.

                      Attachments:
                    • #29011
                      Alexander Bautz
                      Keymaster

                        How are you constructing the variable?

                        I’ll have to look into it and see if I might be able to recreate the problem.

                        Alexander

                      • #29013
                        Tricia S.
                        Participant

                          I’m Not using any formulas or Functions yet. In my custom JS I just have:

                          var myCAML = “<Value Type=’Integer’>1</Value><Value Type=’Integer’>4</Value>”;

                          I have also tried adding more quotes but it just made it worse.

                        • #29015
                          Alexander Bautz
                          Keymaster

                            I have confirmed that this is a bug and will fix it in the next release – maybe later this weekend or early next week.

                            PS: My previous comment about the Write your own CAML-query field had to contain <Where> was wrong – as long as this field is not empty, the custom CAML will be used.

                            Alexander

                          • #29058
                            Tricia S.
                            Participant

                              Thanks Alexander,

                              While on the Subject of vars, Can we use the {var:name_of_Var} in the “BaseUrl of the list” on the Cascading dropdowns?
                              I reviewed the change log and only found where it could be used in the list values.
                              I am finding that having a var for the Site here would be extremely helpful.

                              Thanks,
                              Tricia

                            • #29061
                              Alexander Bautz
                              Keymaster

                                This is currently not an option, but I’ll add it in the next release.

                                You can however write the entire function call in Custom JS – look at the documentation linked in the top of the Cascading dropdown tab in DFFS config.

                                Alexander

                              • #29063
                                Tricia S.
                                Participant

                                  Thanks Again Alexander! I have done it before. Just can be a bit of a pain when you have that nice UI tab I could use instead. Thanks for adding to the next release! I’m really looking forward to this next release now. 🙂

                              Viewing 13 reply threads
                              • You must be logged in to reply to this topic.