Alexander Bautz

Forum Replies Created

Viewing 15 posts - 121 through 135 (of 4,705 total)
  • Author
    Posts
  • in reply to: $().SPServices() is not a function. #37829
    Alexander Bautz
    Keymaster

      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

      in reply to: Trouble with field and current user email matching #37827
      Alexander Bautz
      Keymaster

        Thanks for the detailed description – I’ll get this fixed in a new version over the weekend or early next week.

        Alexander

        Alexander Bautz
        Keymaster

          Thanks for the detailed descriptions – I’ll get this fixed in the next version.

          Alexander

          in reply to: DFFS Email Alert #37796
          Alexander Bautz
          Keymaster

            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

            in reply to: Get user input prior to sending email #37789
            Alexander Bautz
            Keymaster

              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}"
              });
              
              in reply to: Get user input prior to sending email #37782
              Alexander Bautz
              Keymaster

                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

                in reply to: Get user input prior to sending email #37778
                Alexander Bautz
                Keymaster

                  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
                  in reply to: Easy way to make all fields readonly? #37771
                  Alexander Bautz
                  Keymaster

                    I’m glad you figure it out.

                    Alexander

                    in reply to: Easy way to make all fields readonly? #37761
                    Alexander Bautz
                    Keymaster

                      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

                      in reply to: Easy way to make all fields readonly? #37757
                      Alexander Bautz
                      Keymaster

                        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

                        in reply to: Easy way to make all fields readonly? #37752
                        Alexander Bautz
                        Keymaster

                          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

                          in reply to: Easy way to make all fields readonly? #37747
                          Alexander Bautz
                          Keymaster

                            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

                            in reply to: Request for alternate deployment method #37742
                            Alexander Bautz
                            Keymaster

                              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

                              Alexander Bautz
                              Keymaster

                                Thanks,
                                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

                                Alexander Bautz
                                Keymaster

                                  Thanks, I’ll fix this in the next release.

                                  Alexander

                                Viewing 15 posts - 121 through 135 (of 4,705 total)