› Forums › Autocomplete › Autocomplete setFields SPFieldUser
Tagged: Autocomplete setFields
- This topic has 2 replies, 2 voices, and was last updated 3 years, 11 months ago by
BenR.
-
AuthorPosts
-
-
October 24, 2019 at 14:06 #27463
BenR
ParticipantAlexander,
I am attempting to setFields from a SPFieldUser to SPFieldUser, both named FinanceManager:
{ "fromFIN":"FinanceManager", "joinBy":"", "toFIN":"FinanceManager", "parseFunction":"", "skipIfEmpty":false },
In my toFIN, I am getting lastName firstName as two values instead of one – see attachment.
How can I accomplish my objective?
In advance, I appreciate your support and efforts!
R’grds – Ben.
Reference:
Version informationDFFS 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, 2019Attachments:
-
October 24, 2019 at 19:34 #27472
Alexander Bautz
KeymasterThis is because when you set a PP and the value has a comma in it, the value is interpreted as two different names.
The solution is different if you use REST or not – see code examples below.
With “useREST”: false
{ "fromFIN": "FinanceManager", "joinBy": "", "toFIN": "FinanceManager", "parseFunction": "fixPP_NO_REST", "skipIfEmpty": false },
Add this function below the call to spjs.ac.textField({…});
function fixPP_NO_REST(a){ var r = ""; try{ var user = spjs.utility.userInfo(a[0].split(";#")[0]); r = user.Name; }catch(ignore){ // Nothing } return r; }
With “userREST”: true
{ "fromFIN": ["FinanceManager/Name"], "joinBy": "", "toFIN": "FinanceManager", "parseFunction": "", "skipIfEmpty": false }
Alexander
-
October 24, 2019 at 19:50 #27474
BenR
ParticipantAlexander,
Nicely done! Thank you so much for your support and efforts!
R’grds – Ben.
-
-
AuthorPosts
- You must be logged in to reply to this topic.