setFields multiple fields

Forums Autocomplete setFields multiple fields

Viewing 3 reply threads
  • Author
    Posts
    • #16890
      avala
      Participant

      Is it possible to set multiple fields based on the autocomplete field value? For example, some code like:

      
      
      	"setFields":[
      		{
      			"fromFIN":["Title","Address"],
      			"toFIN":["ShippingToProjectName","SendToAddress"],
      			"parseFunction":"",
      			"skipIfEmpty":false
      		}
      	]

      Title and Shipping to Project Name are both single line text fields.
      Address and SendToAddress are multi-lines.

    • #16893
      Alexander Bautz
      Keymaster

      Like this:

      	"setFields":[
      		{
      			"fromFIN":"Title",
      			"toFIN":"ShippingToProjectName",
      			"parseFunction":"",
      			"skipIfEmpty":false
      		},
      		{
      			"fromFIN":"Address",
      			"toFIN":"SendToAddress",
      			"parseFunction":"",
      			"skipIfEmpty":false
      		}
      	]

      Alexander

      • This reply was modified 6 years, 10 months ago by Alexander Bautz. Reason: Removed brackets from "FromFIN" and "toFIN"
      • #16895
        avala
        Participant

        Thanks, Alexander.

        Made a minor change in the code as the extra brackets around the Field Internal names prevent the set field action (see below). One thing I noticed is that this seems to force the (Plain Text) Multi-line text field (SendToAddress) act like a single line text field. Seems like carriage returns are disabled for both values entered in through the SetFields action and when I try to manually type text. Anyway to avoid this or is this built into the Autocomplete plugin?

        
        
        spjs.ac.textField({
        	"applyTo":"ShippingToProject",
        	"helpText":"Project number...",
        	"listGuid":"Project Information",
        	"listBaseUrl":"/sites/equip",
        	"showField":"Customer",
        	"enforceUniqueValues":true, // New in v1.33
        	"rowLimit":15,
        	"listOptionsOnFocus":true,
        	"minLengthBeforeSearch":3, // New in v 1.4.12
        	"reValidateOnLoad":true,
        	"allowAddNew":false, // New in v1.4
        	"isLookupInSelf":false, // New in v1.4
        	"filterCAML":"", // New in v1.4.3
        	"multiselect":false, // New in v1.4.4. If this is true, the "setFields section will not apply",
        	"multiselectSeparator":"; ", // New in v1.4.4.
        	"orderBy":[{"fin":"Customer","ascending":true}], // New in v1.4.5
        	"setFields":[
        		{
        			"fromFIN":"Title",
        			"toFIN":"ShippingToProjectName",
        			"parseFunction":"",
        			"skipIfEmpty":false
        		},
        		{
        			"fromFIN":"Address",
        			"toFIN":"SendToAddress",
        			"parseFunction":"",
        			"skipIfEmpty":false
        		},
        		{
        			"fromFIN":"Tax_x0020_Jurisdiction",
        			"toFIN":"TaxJurisdictionCode",
        			"parseFunction":"",
        			"skipIfEmpty":false
        		}
        	]
        });
    • #16898
      Alexander Bautz
      Keymaster

      Hi,
      You are right about the brackets – I didn’t notice it when I copied your original code.

      I’m not sure what you mean with the multiline text field. Are both the “Address” and “SendToAddress” multiple lines of plain text? – I did a test here and it looks like the linefeeds are preserved.

      Alexander

      • #16900
        avala
        Participant

        Yes, both are multiple line plain text fields. If it’s working for you, I’ll explore things further on my end.

    • #16902
      Alexander Bautz
      Keymaster

      You can email me some screenshots if you like – maybe I can figure out what is goint on.

      Alexander

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