Redirect to Edit form error

Home Forums Classic DFFS Redirect to Edit form error

Viewing 5 reply threads
  • Author
    Posts
    • #16119
      avala
      Participant

        Alexander,

        Excited to start using the redirect to edit form from the February release, but I’m getting an error in our 2010 environment.

        Nothing happens when I click the new redirect button. The console debugger shows:

        SCRIPT5009: ‘SPUpdatePage’ is undefined
        eval code (357) (1,199768).

        Did I miss configuring something? The DFFS manual doesn’t appear to be updated with this feature yet.

      • #16121
        Alexander Bautz
        Keymaster

          Hi,
          I could swear that I checked this in SP 2010, but I might have missed something. It seems this function is not part of the SP 2010 platform, but as the code expects it you need to add a dummy function to the custom js like this:

          SPUpdatePage = function(){};

          Please let me know if you have other issues in SP 2010.

          Best regards,
          Alexander

          • #16125
            avala
            Participant

              I’ve added the above script to the custom JS tab. The button does submit the form and close the page, but it returns to the list view (default behavior).

          • #16123
            Alexander Bautz
            Keymaster

              It might be that this doesn’t work at all in SP 2010, but please let me know how it works out – and I’ll do my best to get it running.

              Alexander

            • #16139
              Alexander Bautz
              Keymaster

                Could you try the latest BETA and see if it works better?

                Best regards,
                Alexander

                • #16141
                  avala
                  Participant

                    The Beta works perfectly in 2010 and does not require

                    SPUpdatePage = function(){};

                    Now I just need to figure out how to prevent the user from editing the form until the workflow has finished. Thanks, Alexander! When do you anticipate the DFFS production files will be updated?

                • #16143
                  Alexander Bautz
                  Keymaster

                    Thanks for the feedback – I’m glad the redirect worked now.

                    Regarding the wrokflow status:
                    You can set up a rule in DFFS with the trigger “Workflow status (BETA)” to give an alert and call a function like this in “Run these functions / trigger these rules” – put this function in Custom JS:

                    function customReloadPage(){
                        location.href = location.href; // looks strange, but reloads the form cleanly
                    }

                    I haven’t gotten any feedback on this trigger so either it works flawlessly, or no one has used it yet!

                    Alexander

                    • #16145
                      avala
                      Participant

                        Wow, that is WAY BETTER than what I was building. THANK YOU! The only improvement I would make is to customize the refresh time. Having the page reload 10 times makes it look broken.

                        The BETA release also fixed the issue we had with the DFFS Installer not working in 2010. This is HUGE. All combined, the redirect feature, ReloadPage function, and installer package will save us 1-2 hours of deployment time per project!

                        • This reply was modified 7 years, 8 months ago by avala.
                      • #16149
                        avala
                        Participant

                          Had to revert to our former solution since the one above kept refreshing the page too quickly and made the form look broken.

                          I ended up placing a rule on a Yes/No dsropdown field that our On Creation workflow would update as its last step. On Form load, if this field was still “No,” the rule would hide the form tab and show a tab with some HTML and a loading .gif. This custom refresh function reloads the page after 25 seconds.

                          
                          
                          function customReloadPage(){
                          setTimeout("window.open(self.location, '_self');", 25000);
                          }
                      • #16160
                        Alexander Bautz
                        Keymaster

                          Hi,
                          I’m glad you found a solution. I should have provided you with a better code example though – you can modify my existing code snippet like this:

                          function customReloadPage(){
                              spjs.dffs.dlgBox("<div id='customReloadMsg' style='font-size:16px;padding:10px;'>The workflow hasn't finished yet. Hit OK to pause for 10 seconds and do a new check.</div>",false,function(){
                                  jQuery(".dffs_dlg_box input:button:first").remove();
                                  var ticker = 10;
                                  setInterval(function(){
                                      jQuery("#customReloadMsg").html("Doing a new check in "+ticker+" seconds...");
                                      ticker -= 1;
                                  },1000);
                                  setTimeout(function(){
                                      location.href = location.href; // looks strange, but reloads the form cleanly
                                  },10000);
                              },function(){
                                  location.href = location.href.split(/editform.aspx/i).join("DispForm.aspx");
                              });
                          }

                          Alexander

                      Viewing 5 reply threads
                      • You must be logged in to reply to this topic.