› Forums › Classic DFFS › Redirect to Edit form error
- This topic has 9 replies, 2 voices, and was last updated 7 years, 1 month ago by Alexander Bautz.
-
AuthorPosts
-
-
March 14, 2017 at 22:48 #16119avalaParticipant
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.
-
March 14, 2017 at 23:26 #16121Alexander BautzKeymaster
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 -
March 14, 2017 at 23:29 #16123Alexander BautzKeymaster
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
-
March 16, 2017 at 18:07 #16139Alexander BautzKeymaster
Could you try the latest BETA and see if it works better?
Best regards,
Alexander-
March 16, 2017 at 20:02 #16141avalaParticipant
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?
-
-
March 16, 2017 at 21:30 #16143Alexander BautzKeymaster
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
-
March 16, 2017 at 22:41 #16145avalaParticipant
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, 1 month ago by avala.
-
March 17, 2017 at 21:52 #16149avalaParticipant
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); }
Attachments:
-
-
March 20, 2017 at 23:51 #16160Alexander BautzKeymaster
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
-
-
AuthorPosts
- You must be logged in to reply to this topic.