Home › Forums › Cascading dropdowns › Possible Bug in Edit Form with Multi-Select
Tagged: Cascading; Multi Select
- This topic has 27 replies, 3 voices, and was last updated 4 years, 9 months ago by Alexander Bautz.
-
AuthorPosts
-
-
January 19, 2017 at 15:44 #15157
Hi Alexander,
I may have run into a bug in the Edit form when using a multi-select cascade. The issue presents itself when the multi-select field only has a single option available. When this is the case, the underlying SP field is not populated when loading the edit form (see attached image).
The ‘All Options’ and ‘Selected Options’ boxes are outlined in red, and I have to remove the ‘selected option’ and add it back for it to update the SP field correctly. Otherwise, if you save the form without re-adding the selection, it saves the item with an empty SP field.
If the multi-select field has more than one option available, it populates the underlying SP field with the selected option(s) correctly on load.
I have updated my install to the latest version of DFFS (4.4.2.5) and Cascading Dropdowns (3.6.6)
Any help resolving this would be appreciated.
Thanks,
BrentAttachments:
-
January 21, 2017 at 19:58 #15202
Hi,
I have looked at it, and think I have found the cause. I’m away for the weekend, and will not be able to publish a new version until late Sunday – or possibly Monday.Alexander
-
January 23, 2017 at 21:09 #15222
Could you please test this new version to see if it behaves better?
Get it here and replace it in “SPJS/DFFS/plugins”.
As the “DFFS loader” has not been updated you might find the previous version cached. Look at the version information by hovering over the “Enhanced with DFFS” link below the DFFS enabled form, and ensure the cascading dropdown plugin has v3.6.7. If not, try opening the developer tools > network and clear the cache from there.
Alexander
-
January 23, 2017 at 21:34 #15224
Thanks for the quick response Alexander!
I just ran through several tests and it appears to be fixed with v3.6.7
Thanks again!
Brent -
January 26, 2017 at 21:15 #15282
Thanks for the feedback.
Alexander
-
December 9, 2019 at 12:57 #27889
I all,
I’m reviving this topic because lately I’m having this issue with Cascading and Multi Select, trying to tackle it for 5 days but no success. Here’s the info:
Version information
DFFS Loader: v1
DFFS frontend: 4.4.4.16 – November 28, 2019
DFFS frontend CSS: 4.53 /
Autocomplete: 1.6.42 – November 28, 2019
Cascading dropdowns: 3.7.32 – October 27, 2019
jQuery: 1.12.4
Lookup: 1.1.19 – October 27, 2019
Resource management: not loaded
SPJS-Utility: 1.340 – November 28, 2019
vLookup: 2.2.142 – November 28, 2019Also attached some printscreens, first one is the real list on production server, the second one is a test I made only with cascading two fields from another list and without MultiSelect on dev server
Attachments:
-
December 9, 2019 at 15:20 #27893
Can you also show me a screenshot of the source list where you get the data from?
Do you use single line of plain text in the source list and also single line or multiple line of PLAIN TEXT in the current list for the cascading dropdown fields?
Are you using any filters in the casc setup that makes the previous selected items not show in the current list of possible options?
Alexander
-
December 9, 2019 at 15:53 #27895
Screenshot of the source: Capture-casc03.PNG
Screeshot of the current: Capture-casc04.PNG and is filter Capture-casc05.PNG
Hope it clarifies
Attachments:
-
December 9, 2019 at 16:18 #27902
Can you confirm that the field “Entidades” is a multiline PLAIN TEXT field?
It’s hard to tell exactly what it could be without looking at it, but does it work if you do not use the filter CAML query?
Alexander
-
December 9, 2019 at 16:27 #27904
Sorry. Thank for quick replys
Field “Entidades” setup: Capture-casc06.PNG
Q: “…but does it work if you do not use the filter CAML query?”
A: No it does not. Same result as showed in Capture-casc01.PNG. Tested it before in a simple cascade on EditForm (Capture-casc02.PNG)Attachments:
-
December 9, 2019 at 16:41 #27907
Try activating “debug” by setting
"debug": true
in the argument to the function spjs.casc.init and post the output / screenshot.
Alexander
-
December 9, 2019 at 16:53 #27909
Has requested
With CAML: Capture-casc07.PNG
Without CAML: Capture-casc08.PNG
- This reply was modified 4 years, 9 months ago by Filipe Ribeiro.
Attachments:
-
December 9, 2019 at 21:43 #27917
All looks right, but I’m wondering how the source list date is created. Is it manually entered or based on some kind of integration writing the data from another date source?
The reason I ask is that I have seen similar problems when the source data contained invalid (and invisible) characters – like a line feed in a single line of text field.
Alexander
-
December 10, 2019 at 12:18 #27924
Hi Alexander,
Actually we’ve imported “Distrito” and “Concelho” from XLS into the database, to a another list called “DiCo”. This list then feeds fields in “Entidade”, then a third one, the problematic, gets data from “Entidade”, on NewForm the cascading is working fine but the edit does not.
Don’t know what to try anymore. But did you succeed on fixing the problems when the source data contained invalid (and invisible) characters?
- This reply was modified 4 years, 9 months ago by Filipe Ribeiro.
-
December 10, 2019 at 12:36 #27927
Hi again
Thanks to what you wrote I created a test list (Test_List) without imported data from external source. Created a cascading to read data from itself and I get no errors 😮
Based on this, what you suggest? Check the imported data for “invalid”/invisible characters?
Attachments:
-
December 10, 2019 at 14:14 #27931
We found the issue
On “Entidades” list we can have more them one “Setor de Atividade” (another list). Based on that, the data is loaded on a note field, multiline in “Entidades”, and the data as a line brake ;\n in the end. On the database this scenario is confirmed.
-
December 10, 2019 at 16:00 #27933
@Alexander your questions lead us to the problem. Thanks for the fast reply
-
December 10, 2019 at 16:25 #27935
I’m glad you identified the problem. As you already have figured out, the fix must be applied in the integration code to remove the invalid characters.
Alexander
-
December 10, 2019 at 20:08 #27938
Can you help showing the direction to clear the invalid (linebrake) on save in NewForm.aspx? Or something?
Unfortunately don’t know how to fix due to programming knowledge limitation 🙁
-
December 10, 2019 at 21:40 #27946
The invalid characters are removed when you save in NewForm by SharePoint already so the problem is that when you load the item in EditForm, the current data in the form does not match the values pulled from the datasource because your current form value is like this:
Test value
but the value pulled from the datasource is like this:
Test value
This means the form does not find the current value in the dataset and shows it as invalid.
The best would be to fix the values as they are written to the list by your other code, but if this is not possible you can use this method and then loop over the dataset – removing any invalid characters. This method requires that you pull in all the data so if your dataset is large (over 5000 items) it might take some time to load the form.
Let me know if you are not able to fix this in the other end and I can help you write the function to clean the data.
Alexander
-
December 11, 2019 at 11:46 #27959
Hello @Alexander,
Thanks for the reply, analysed the method you mention but I have doubts how to do it with it, and I don’t actually think how it will resolve. Let me explain a bit further the case. I will reference lists only by letters to simplify the explanation, we got:
# List A (on EditForm.aspx)
– Data was imported from .xls> Capture-SA-01.PNG
> Capture-SA-02.PNGResult: All data seems fine, no “;”,no linebrake (\n or <br>) and no spacings. Also accessed database with MS Access to validate.
# List B (on NewForm.aspx)
– Acquires data from List A
– Source field – SPFieldText
— Destiny field – SPFieldNote, Plain text
— “Method” through a cascading in DFFS> Capture-EntSA-01.PNG
> Capture-EntSA-02.PNG
> Capture-EntSA-03.PNGResult: All data has “;” and linebrakes
# List C (on NewForm.aspx)
– Acquires data from List B.# List C (on EditForm.aspx)
– If we manage to fix the issue between #A and #B probably #C will be valid, but let’s problem at the time 🙂> Capture-casc01.PNG
(PART 1/2)
Attachments:
-
December 11, 2019 at 11:47 #27965
(PART 2/2) – The rest of the printscreens
Hope you can help me out sorting this issue ?
- This reply was modified 4 years, 9 months ago by Filipe Ribeiro.
Attachments:
-
December 12, 2019 at 11:35 #27986
Hello again,
Activated the debug on “Field:multiline” cascading and once you choose one option the field adds an linebrake 🙁
Check image for reference
Attachments:
-
December 12, 2019 at 21:13 #27993
The line feed you find in the textarea when using the debug:true is intended and is added by the CASC script to ensure the output when viewed in DispForm is split into separate lines and it is not a caused by invalid data in the source list.
The problem with locating the line feed in the source list is that SharePoint actually strips away and hides it when you view the data in the form. The only way to identify it is by querying the list and looking at the return value.
Do you get the error in all records in the list, or only some records?
Alexander
-
December 13, 2019 at 12:35 #27998
It’s giving me error in all records in EditForm (List B). Check image Capture-EntSA-05.PNG, the data from that field is saved with an “;\n” in NewForm.
If I edit the field and manually remove the “;\n”, when I access EditForm everything if fine
- This reply was modified 4 years, 9 months ago by Filipe Ribeiro.
Attachments:
-
December 13, 2019 at 16:56 #28002
Sorry, but I’m a bit confused – do you mean editform of the source list for the cascadig dropdown or the current list where you use the cascading dropdown to pick the values?
Alexander
-
December 13, 2019 at 17:02 #28005
The EditForm of the final list (B) were origin data (A) is pulled into. From List A into List B
-
December 15, 2019 at 10:45 #28033
It’s unfortunately hard to troubleshoot without looking at it directly.
You wrote:
On “Entidades” list we can have more them one “Setor de Atividade” (another list). Based on that, the data is loaded on a note field, multiline in “Entidades”, and the data as a line brake ;\n in the end. On the database this scenario is confirmed.
Can you show me a screenshot of one of the items in your Entidade from DispForm so I can see the value in the field?
I also want to clarify that the linefeed (;\d) in the current list where you use the cascading dropdown in :multi mode is supposed to be there between all selected values. This is by design to make it more readable in DispForm. You can however change this when you call the Cascading dropdown function manually form Custom JS like described here: https://spjsblog.com/dffs/dffs-plugins/spjs-cascading-dropdowns/#Change_multichoiceDelimiter
You might want to try that and replace the multichoiceDelimiter to see if it works better for you. Please note that to do that you must and move the code to Custom JS and delete the settings from the Cascading dropdowns tab.
PS: I had not documented the multichoiceDelimiter parameter until today.
Alexander
-
-
AuthorPosts
- You must be logged in to reply to this topic.