Autocomplete setFields SPFieldMultiChoice

Forums Autocomplete Autocomplete setFields SPFieldMultiChoice

Viewing 2 reply threads
  • Author
    Posts
    • #27403
      BenR
      Participant

      Alexander,

      I admit that I don’t understand the syntax, and have to ask (I have searched this forum, but don’t see an answer…).

      In Autocomplete, I am attempting to setFields from a SPFieldMultiChoice to a SPFieldMultiChoice – both named “TechCommodities.” With the following code, I get only one value set to the toFIN where the source has two values:

      
      
      "setFields": [	
          {
              "fromFIN":"TechCommodities",
              "joinBy":"",
              "toFIN":"TechCommodities",
              "parseFunction":"",
              "skipIfEmpty":false
          }
      ],

      Can you tell me where I have gone wrong?

      In advance, thank you for your support and efforts!

      R’grds – Ben.
      Reference:
      Version information

      DFFS Loader: v2
      DFFS frontend: 4.4.4.13 – October 14, 2019
      DFFS frontend CSS: 4.51 / 4.51
      Autocomplete: 1.6.38 – October 14, 2019
      Cascading dropdowns: 3.7.31 – October 14, 2019
      jQuery: 1.12.4
      Lookup: 1.1.18 – October 14, 2019
      Resource management: 2.4.5 – August 29, 2019
      SPJS-Utility: 1.337 – September 04, 2019
      vLookup: 2.2.138 – September 04, 2019

    • #27412
      Alexander Bautz
      Keymaster

      You need to use the parseFunction option like this:

      "setFields": [
          {
              "fromFIN": ["TechCommodities"],
              "toFIN": "TechCommodities",
              "parseFunction": "multichoiceField",
              "skipIfEmpty": false,
              "joinBy": ""
          }
      ]

      And then add this function to your custom js:

      function multichoiceField(a){
          return String(a).split(";#");
      }

      Alexander

    • #27419
      BenR
      Participant

      Alexander,

      Most excellent! This worked, and a good lesson taught!

      As always, thank you for your support and efforts!

      R’grds – Ben.

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