Forum Replies Created
-
AuthorPosts
-
Hi,
SPServices is not part of DFFS. If you want to use it you must load it in the textarea above Custom JS.You don’t need to use it either as DFFS has built in support for getting list items – see this thread for example code: https://spjsblog.com/forums/topic/query-update-delete-an-item-in-javascript/
Alexander
Thanks for the detailed description – I’ll get this fixed in a new version over the weekend or early next week.
Alexander
July 23, 2024 at 10:42 in reply to: Question about modern DFFS and Lookup column functionality #37820Thanks for the detailed descriptions – I’ll get this fixed in the next version.
Alexander
Using a SP2013 workflow should not be a problem, but I don’t have any examples on the setup. You can find some general information here: https://support.microsoft.com/en-us/office/send-email-in-a-workflow-11d5f9dd-955f-412c-b70f-cde4214204f4
You should be able to find the same type of actions in SP2013 WF as in SP2010 WF to replicate the steps see in the user manual here: https://spjsblog.com/dffs/dffs-user-manual/#Set_up_the_workflow
Alexander
It is not possible to send it after the form is saved because the classic DFFS is using the built-in save function in SharePoint and you are automatically redirected away from the form when the save completes – effectively cutting off any ongoing custom code you have running.
You can modify it like this to send the email – and if it is successfully sent, the form is saved.
function sendCustomEmail(arg){ spjs.dffs.alert({ "title": "Enter a return reason", "msg": "<textarea style='width:100%;box-sizing:border-box;height;75px;' id='varFromAlertInput_input'></textarea>", "ok": function(){ var fromAlertInput = jQuery("#varFromAlertInput_input").val(); spjs.dffs.REST_Email({ "to": arg.to, "cc": arg.cc, "bcc": arg.bcc, "subject": arg.subject, "body": arg.body.split("{0}").join(fromAlertInput) }).done(function(success){ if(success){ spjs.dffs.triggerSave(); } }).fail(function(err){ alert("Sending failed with this error: " + err.responseJSON.error.message.value); }); }, "cancel": function(){ // Close dialog } }); } sendCustomEmail({ "to": ["alexander@spjsblog.com"], "cc": [], "bcc": [], "subject": "The subject of the email", "body": "The default body - the variable from the input will be inserted by replacing this token: {0}" });
I fixed a missing quote in the code snippet above. You can wrap it in a function something like this to use it from different other functions:
function sendCustomEmail(arg){ spjs.dffs.alert({ "title": "Enter a return reason", "msg": "<textarea style='width:100%;box-sizing:border-box;height;75px;' id='varFromAlertInput_input'></textarea>", "ok": function(){ var fromAlertInput = jQuery("#varFromAlertInput_input").val(); spjs.dffs.REST_Email({ "to": arg.to, "cc": arg.cc, "bcc": arg.bcc, "subject": arg.subject, "body": arg.body.split("{0}").join(fromAlertInput) }); }, "cancel": function(){ // Close dialog } }); } // Call the function like this sendCustomEmail({ "to": ["alexander@spjsblog.com"], "cc": [], "bcc": [], "subject": "The subject of the email", "body": "The default body - the variable from the input will be inserted by replacing this token: {0}" });
Alexander
Try it like this:
spjs.dffs.alert({ "title": "Enter a return reason", "msg": "<textarea style='width:100%;box-sizing:border-box;height;75px;' id='varFromAlertInput_input'></textarea>", "ok": function(){ var fromAlertInput = jQuery("#varFromAlertInput_input").val(); spjs.dffs.REST_Email({ "to": ["user@sdomain.com"], "cc": [], "bcc": [], "subject": "This is a test email", "body": "This is the message: " + fromAlertInput }); }, "cancel": function(){ // Close dialog } });
Please note that this uses the built in SharePoint REST API to send the message and the recipient(s) must be members of the site.
Alexander
- This reply was modified 6 months, 2 weeks ago by Alexander Bautz. Reason: Fixed missing double quote
I’m glad you figure it out.
Alexander
Ah, now I understand. You must remove this function and use the setting in the Misc tab named “Multiple-choice columns (checkboxes and radio buttons) in multiple columns”.
Alexander
You basically just remove the contents of the /SPJS/DFFS folder and upload the contents of the zip-file you downloaded.
If your old installation was done using the “version 1 installer” you should update to V2 and then use the installer to uninstall and then reinstall DFFS to the forms.
The uninstall / reinstall will not affect your configurations – they are stored in a separate list in your site and will pop back when you reinstall.
Follow the instructions in the installation manual here: https://spjsblog.com/dffs/dffs-installation-manual/#Upgrading_from_a_previous_version
Alexander
What version of DFFS are you running? – it might be a bug in an older version.
If you are up to date, I think there might be interference from other rules – look at all rules that interacts with the same fields and see if you might need to change the “reversing” of rules that are not evaluated to true.
Alexander
I suggest you create a new rule that triggers on “No trigger (must be triggered manually)”. In this rule you add all the ReadOnly fields you want to set. Name the rule for example “DoAlotOfFieldsReadonly”
Now, in your Custom JS you call this rule like this to set all fields readonly:
spjs.dffs.triggerRule(["DoAlotOfFieldsReadonly"]);
Alexander
I see,
the only way to install is to add it to either the tenant app catalog or the site collection app catalog. There is unfortunately no other option that I know of.You can probably use PowerShell to install it, but I haven’t tested that myself so you must look at the PnP PowerShell documentation.
Alexander
May 28, 2024 at 15:11 in reply to: Unusual error 1.0.59.0 – Configuring NewForm does not open #37740Thanks,
I have made one change that I’m pretty sure will prevent this issue in the future. I’ll publish a new version later this week.Alexander
Thanks, I’ll fix this in the next release.
Alexander
-
AuthorPosts