Home › Forums › Classic DFFS › Auto Fill Fields if the user selects a name that already exists
- This topic has 8 replies, 2 voices, and was last updated 3 years, 7 months ago by Alexander Bautz.
-
AuthorPosts
-
-
April 7, 2021 at 15:07 #33175
I hope I can explain properly. We have a list that we keep current and historical info in. If a user wants to update an item, I have it already set to search for the current names so they can select it. Now, once they select a name, I want the other fields to fill in with the list entry listed as the active entry.
I thought about cascading drop downs but is there a better way?
-
April 8, 2021 at 15:18 #33179
Hi,
It could be done with some custom code, but to write an example I need the internal name of the field that mark an item as active, the “name” field and the fields to update (internal name and field type).Alexander
-
April 13, 2021 at 12:48 #33191
VQName – This is the name of the field the user will search up
Current_x0020_Flag – Boolean to ID current record
Attribute1 – First field that I would like to autopopulate.the rest of the fields are Attribute2 through Attribute12
There are also StartDate and EndDate fields but I think the Current Flag is what I want to look at.
-
April 13, 2021 at 12:56 #33193
Sorry for the double post but I have some Custom JS so the user can start typing the VQName and it will return a list matching what they type.
-
April 15, 2021 at 15:47 #33217
Sorry for the late reply – can you show me the code you use to select the VQName? – also, is it a single ling of text field or a people picker?
Please also tell what kind of field types Attribute1-12 are because the values might need to be cleaned up before writing to the form when using a query to get the old item.
Alexander
-
April 16, 2021 at 15:56 #33257
spjs.ac.textField({ "applyTo": "Title", "helpText": "", "loadText": "", "listGuid": "{c7d70902-b17b-4cd1-bd33-6fd55219de3e}", "listBaseUrl": "/sites/CCSSMandR/MIS", "showField": "Title", "searchFields": [], "filterCAML": "", "useREST": false, "preloadData":false, "filterREST": "", "optionDetailFields": [], "optionDetailPrefix": [], "enforceUniqueValues": false, "rowLimit": 15, "listOptionsOnFocus": false, "minLengthBeforeSearch": 4, "reValidateOnLoad": false, "allowAddNew": true, "addToFolder": null, "isLookupInSelf": true, "addNewAdditionalFields": [], "multiselect": false, "multiselectSeparator": "; ", "orderBy": [], "clearSetFieldsOnInvalidSelection": false, "setFields": [], "debug": false });
All fields are single line text.
-
April 17, 2021 at 08:35 #33259
When you use the autocomplete plugin you can automatically pull in the field values using the “setFields” option – https://spjsblog.com/dffs/dffs-plugins/spjs-autocomplete/#setFields
Let me know if you have any further questions.
Alexander
-
-
April 19, 2021 at 14:04 #33262
Worked like a charm. Sorry for completley glossing over that field.
-
April 19, 2021 at 18:52 #33271
No problem, I’m glad it worked.
Alexander
-
-
-
AuthorPosts
- You must be logged in to reply to this topic.