Home › Forums › Autocomplete › setFields multiple fields
- This topic has 5 replies, 2 voices, and was last updated 7 years, 5 months ago by Alexander Bautz.
-
AuthorPosts
-
-
June 16, 2017 at 18:13 #16890
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. -
June 16, 2017 at 19:22 #16893
Like this:
"setFields":[ { "fromFIN":"Title", "toFIN":"ShippingToProjectName", "parseFunction":"", "skipIfEmpty":false }, { "fromFIN":"Address", "toFIN":"SendToAddress", "parseFunction":"", "skipIfEmpty":false } ]
Alexander
- This reply was modified 7 years, 5 months ago by Alexander Bautz. Reason: Removed brackets from "FromFIN" and "toFIN"
-
June 16, 2017 at 19:55 #16895
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 } ] });
-
June 16, 2017 at 22:07 #16898
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
-
June 16, 2017 at 22:12 #16900
Yes, both are multiple line plain text fields. If it’s working for you, I’ll explore things further on my end.
-
-
June 16, 2017 at 22:24 #16902
You can email me some screenshots if you like – maybe I can figure out what is goint on.
Alexander
-
-
AuthorPosts
- You must be logged in to reply to this topic.