Joe Penland

Forum Replies Created

Viewing 12 posts - 16 through 27 (of 27 total)
  • Author
    Posts
  • in reply to: Modern DFFS Formpage DispForm no “Edit” button #36561
    Joe Penland
    Participant

      I would imagine you already know how to check the permissions agains the list, but if it would help I can provide some code I use to do this type of permissions check in my own web parts. Just let me know if it would be helpful.

      in reply to: Modern DFFS Formpage DispForm no “Edit” button #36560
      Joe Penland
      Participant

        I did a little more digging and found it seems to be a permissions issue.

        I am testing with an account which has “Contribute” permissions on the list, but “Read” permissions on the site and site page which hosts the web part. It seems as though perhaps the web part is checking user permissions based on the page context or site, but not based on the actual list being passed through the DFFSList parameter. Is that possible? I would like to allow people to edit list items without giving them edit access to the whole site, or even to the page hosting the web part.

        I tested adding the account to the site members group and the edit buttons came back. However, once I removed them again and they are only in the site visitors group, the buttons disappear again. When directly on the list, the account can see the edit buttons as expected due to having “Contribute” permission on the list.

        in reply to: Redirect after save/cancel #36535
        Joe Penland
        Participant

          It looks like everything is working now! Thank you for publishing the new version with the update.

          in reply to: Redirect after save/cancel #36524
          Joe Penland
          Participant

            No problem! Thank you for all you do to make this a great product that works for so many different scenarios. I look forward to testing it out again after the next version comes out.

            in reply to: Redirect after save/cancel #36522
            Joe Penland
            Participant

              I realized I didn’t really explain my purpose. I want to set up the function so it can dynamically pull the redirect destination from the URL search parameters because the page I link FROM may change and I am putting the current page in the search parameters under a “DFFSSource” parameter. If that parameter is present, I want to redirect users to whatever URL is passed. I am testing with “https%3A%2F%2Fwww%2Egoogle%2Ecom” as the source and it logs correctly in the console as https://www.google.com just before navigating to Google when I test by clicking a button. When I cancel the form, nothing logs to the console and nothing happens. I don’t get errors, I just don’t get anything.

              in reply to: Redirect after save/cancel #36521
              Joe Penland
              Participant

                I also tried with this but still, I can see the action take place on clicking a button, but not on cancelling the form.

                function saveCancelRedirect() {
                let searchParams = new URL(document.location).searchParams;
                let dffsSource = decodeURIComponent(searchParams.get(“DFFSSource”));
                console.log(‘dffsSource:’);
                console.log(dffsSource);
                console.log(typeof dffsSource);

                if (dffsSource !== undefined && dffsSource !== null && dffsSource !== ‘null’) {
                location.href = dffsSource;
                }
                }

                in reply to: Redirect after save/cancel #36520
                Joe Penland
                Participant

                  For some reason it doesn’t seem to be working for me. We are still running v1.0.12.0, but I believe that version includes support for detecting the cancel event.

                  I have this in the Custom JS of the New form:

                  function saveCancelRedirect() {
                  let searchParams = new URL(document.location).searchParams;
                  let dffsSource = decodeURIComponent(searchParams.get(“DFFSSource”));
                  console.log(‘dffsSource:’);
                  console.log(dffsSource);
                  console.log(typeof dffsSource);

                  if (dffsSource !== undefined && dffsSource !== null && dffsSource !== ‘null’) {
                  console.log(‘Redirect to ‘ + dffsSource);
                  }
                  }

                  function dffs_PostSaveAction() {
                  saveCancelRedirect();
                  }

                  function dffs_PostCancelAction() {
                  saveCancelRedirect();
                  }

                  I am able to trigger the function by clicking a button, but it is not triggering when I cancel or close the form.

                  in reply to: Redirect after save/cancel #36517
                  Joe Penland
                  Participant

                    Thanks for your reply. I did see those examples, but I haven’t successfully gotten my functions to trigger when the form is closed or cancelled. I am not seeing the cancel event as something I can use as a trigger.

                    in reply to: Redirect after save/cancel #36515
                    Joe Penland
                    Participant

                      I am finally getting back around to try this out and am having a bit of trouble trying to figure out how to trigger a function on cancelling a form. I don’t see a cancel event in the triggers for the rules. How do I attach my function to a cancel event?

                      I appreciate your help.

                      in reply to: Redirect after save/cancel #36447
                      Joe Penland
                      Participant

                        Thank you! I really appreciate it.

                        in reply to: Redirect after save/cancel #36445
                        Joe Penland
                        Participant

                          Thank you. Yes, in this instance I am sending users to the form from another page, so I want them to come back whether they save or cancel in the form. This would also apply if I just show them the display form for an item and they close it. I would like to send them back to the page of my choice. Adding a way to detect cancelling would be very helpful in order to handle both cases (save and cancel or close).

                          in reply to: Direct link to forms? #36380
                          Joe Penland
                          Participant

                            Thanks for the quick response! I was expecting this answer, but thought I should ask just to confirm before giving up hope. I appreciate it!

                          Viewing 12 posts - 16 through 27 (of 27 total)