locked
Delaying the load of page after click on NewForm.aspx RRS feed

  • Question

  • i have a SharePoint List, with an item added workflow. My workflow will update a list item depending on the value of other column. And in the list view, it will display all items with Division = "IT" (just an example). After clicking the button on the NEWFORM.aspx, the item will not display because the workflow is still on progress. But i need to remove this delay of displaying the items. What can i do to prevent this and display the item immmediately after adding.

    i tried this code below but it is very obvious the effect of page refresh. I need something (javascript) like delaying the load of the page so that it can complete the workflow process then display the list view completely.

    <script type="text/javascript">
       $(document).ready(function(){

                //Check if the current URL contains '#'
                if(document.URL.indexOf("#")==-1)
                {
                    // Set the URL to whatever it was plus "#".
                    url = document.URL+"#";
                    location = "#";

                    //Reload the page
                    location.reload(true);

                }
            });
        </script>


    cal_bonjovi

    Monday, June 17, 2013 4:27 AM

Answers

  • Hi,

    I understand that you want to delay page load using javascript, you can modify your script like this :

    <script src="http://code.jquery.com/jquery-latest.js" type="text/javascript"></script><script type="text/javascript">

       $(document).ready(function(){

                //Check if the current URL contains '#'

                if(document.URL.indexOf("#")==-1)

                {

                    // Set the URL to whatever it was plus "#".

                    url = document.URL+"#";

                    location = "#";

                    //Reload the page

                    setTimeout(function(){location.reload(true);},3000); // stop 3 seconds before reload the page. You can increase the time to 5000 that is 5 seconds

                }

            });

    </script>

    Thanks,

    Entan Ming

    TechNet Subscriber Support in forum

    If you have any feedback on our support, please contacttnmff@microsoft.com.


    Entan Ming
    TechNet Community Support

    Tuesday, June 18, 2013 5:46 AM
    Moderator

All replies

  • Hi Cal,

    delay workflow by adding "Pause for duration", due to this first item will get added to the list and second workflow will run.

    Regards,

    karim

    Monday, June 17, 2013 11:41 AM
  • I think you got me misunderstood.

    As we know workflow is processing after clicking the NewForm.aspx button. I need to complete the workflow first before AllItems.aspx is displayed that is why I need a delay before Allitems.aspx is displayed



    cal_bonjovi

    Tuesday, June 18, 2013 1:23 AM
  • Hi,

    I understand that you want to delay page load using javascript, you can modify your script like this :

    <script src="http://code.jquery.com/jquery-latest.js" type="text/javascript"></script><script type="text/javascript">

       $(document).ready(function(){

                //Check if the current URL contains '#'

                if(document.URL.indexOf("#")==-1)

                {

                    // Set the URL to whatever it was plus "#".

                    url = document.URL+"#";

                    location = "#";

                    //Reload the page

                    setTimeout(function(){location.reload(true);},3000); // stop 3 seconds before reload the page. You can increase the time to 5000 that is 5 seconds

                }

            });

    </script>

    Thanks,

    Entan Ming

    TechNet Subscriber Support in forum

    If you have any feedback on our support, please contacttnmff@microsoft.com.


    Entan Ming
    TechNet Community Support

    Tuesday, June 18, 2013 5:46 AM
    Moderator