I've created a 3-step Wizard as the New Form for a Content Type based on Document Set.
When the Finish button is clicked, a red error message appears on the Form:
Cannot read property 'slice' of null
(the user is not redirected anywhere)
Note that the Document Set actually IS created and the collected metadata has been applied.
Widard.Finish is currently set to
Ideally, the users would be directed to the Edit form for the item they just created (without error message). Is that possible as well?
There is a typo in the code. It should be
Do you have any other custom code on the form? Please comment it out and check if you get the same error.
Apologies, that was a typo in my post that isn't in my actual form.
Wizard.Finish is currently set to
I will try commenting out all of my custom code, which currently does the following:
- Cascading Lookups
- Additional fields from items Looked Up
- Generation of field values from other fields filled in by the user
I have the things listed above working now, without seeing the original error message
However, I now have a different error message when clicking the Finish button; it seems an extra dot/period is being added to the end of Name (FileLeafRef) field:
The Document Set is in fact created, but none of the field values
have been saved
Would it be better to start a new post or perhaps submit a ticket? I could provide moar detail in a private message...
Please share the code that you are using to create a Document Set. You can share it here or create a ticket, that is up to you.
I'm not using any code to create the Document Set, other than the 'return fd.save()' in the Wizard.Finish property.
Is that a SharePoint list or Library?
Could you please check if you are getting any errors in the browser console. Please share its screenshot.
Please see the lower left corner of my screenshot above and this one here:
UPDATE: The problem with the FileLeafRef having a dot at the end was indeed my error; I am building up the FileLeafRef value from other fields and the last one did include a dot in some cases. Even though the dot didn't show up in the field's control it was still there in the field's data.
This extra issue has been resolved, but the original error message is now back (Cannot read property 'slice' of null).
I have reproduced this error in a separate tenant, in a brand new Team Site:
No custom code or anything. I literally just added the Wizard to the New Form and then dragged the Name and Description fields onto the step...
Thank you for these details. I was able to reproduce the case on my side, we will investigate the case and I will let you know if the results.
We've published the update that resolved the error.
Please completely clear the browser cache before creating a new Document Set.
Thanks, this works now.
However, it now seems that sorting the items in the drop-down fails. I'll start a new thread if I cannot figure it out.
Sorting was accomplished by calling the .refresh() method on the field after the sort was applied.