Forum Replies Created
-
AuthorPosts
-
December 18, 2023 at 10:41 in reply to: Dialogue/Pop-Up on save if user is missing a required field #37342
Sure, just add this to your custom js:
// Set this to false first var hasSaved = false; window.addEventListener("beforeunload", (event) => { if(!hasSaved){ event.preventDefault(); event.returnValue = true; } });
Now add this to the top of your dffs_PreSaveAction function:
// Set the variable to true to to disable the warning when the form is saved hasSaved = true;
Alexander
December 17, 2023 at 14:40 in reply to: Dialogue/Pop-Up on save if user is missing a required field #37340The PreSaveAction function will never run if the form has empty fields, but you can tap into the PreSaveItem function like this to run your custom code:
var originalPreSaveItem = PreSaveItem; PreSaveItem = function(){ // run custom function here // trigger original PreSaveItem originalPreSaveItem(); }
Alexander
Thanks for the feedback – I’m glad you figured it out.
Alexander
Is the problem that you try to edit the item and get a save conflict because of the workflow updating the item after the user opened it for edit?
If you are using a SharePoint Designer Workflow (not PowerAutomate FLOW) you can try the rule trigger “Workflow status” – read about it by clicking the orange question mark to the right of the trigger-select to open the contextual help.
Set this thread for an example of a custom function you can have this rule trigger: https://spjsblog.com/forums/topic/check-out-feature-triggering-workflows/#post-26487
Alexander
This is now fixed in a new version. Only the SPJS-AC.js file is changed so you can just replace that one, but to ensure the browser cache is cleared you should open the DFFS installer and click the “Update loader file” button.
Alexander
It is a bug that was introduced in the latest version to fix an issue where when clearing a single choice AC the hidden input field was not cleared. I forgot to account for multichoice on this field and this causes the hidden textarea to be cleared when clearing the ac-search field.
I’ll get it fixed in a new version later today.
Alexander
I think this is better solved using some custom js. If you can show me how the fields are set up with the options I can give you an example of a script you can use.
What you basically want to have is an array of all the internal names, loop over them and add an eventlistner to the click of the field and in this click function loop over the fields again to check all values – if any of them are true, trigger a rule that does what you need it to do.
Alexander
It is hard to tell without looking at the code live, but looking at it you might want to join the array with semicolon when writing it to the field – like this:
jQuery("#customMultichoiceSelector").find("input:checkbox:checked").each(function (i, elm) { arr.push(jQuery(elm).val()); }); setFieldValue(fin, arr.join(";"));
Alexander
I don’t think there is any other way than to reduce the number of fields. You can split a large list into multiple lists connected using vLookup (plugin to DFFS).
Alexander
Hi,
If you use the editProps method described here you get an edit item link: https://learn.microsoft.com/en-us/sharepoint/dev/declarative-customization/formatting-syntax-reference#customrowactionThe modern DFFS will work with the editProps and defaultClick options.
Alexander
This is a know issue that I have raised a request with Microsoft about. It affects all solutions of this type – not only DFFS when you update / install a new version.
From my testing it only affects Google Chrome.
It can be fixed by waiting 10-15 minutes, or by clearing the browser data as described here: https://spjsblog.com/forums/topic/starting-to-see-this-error-message-on-any-dffs-enabled-site/#post-37263
Alexander
I have published v1.0.40.0 that should fix the problem – let me know how it works out.
Alexander
I have confirmed the bug and looking at it it looks like this never actually worked. I had mistakenly used both defaultSelectedKey and selectedKey on the dropdown so it would always show “And” even even if you changed the value to “Or”. If you did change it to “Or” it would actually save “Or” even if the dropdown shows “And”.
I’ll get this fixed in a new version later this week.
Alexander
I’ll look into it.
Alexander
November 18, 2023 at 15:36 in reply to: Modern DFFS Formpage NewForm no active “Edit” for Multiple lines of text #37278Sure, I can move it to the left in the next version.
Alexander
-
AuthorPosts