Issue T1580
Visible to All Users
Duplicate

We have closed this ticket because another page addresses its subject:

OnComplete executes multiple times

OnPartianSend and OnComplete both triggering

created 6 years ago

Hi SurveyJS Team,

We have a survey that has both OnPartialSend enabled and OnComplete enabled – both of which saves the survey in our database. Additionally, we also have triggers setup that completes the survey before reaching the end of the survey. What we have noticed is – if on a certain page, we click “Next” and the OnComplete trigger executes, both the OnPartialSend and the OnComplete event trigger and we are saving 2 surveys for the same survey.

Is this a bug? Is there a way to manage this in Survey JS?

Thanks,
Saswat Gorkhali | CRM Consultant | Office: 612.339.3355 x532 | Email:
POYGlobal_EmailSignature

::DISCLAIMER::
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
The contents of this e-mail and any attachment(s) are confidential and intended for the named recipient(s) only. E-mail transmission is not guaranteed to be secure or error-free as information could be intercepted, corrupted, lost, destroyed, arrive late or incomplete, or may contain viruses in transmission. The e mail and its contents (with or without referred errors) shall therefore not attach any liability on the originator or HCL or its affiliates. Views or opinions, if any, presented in this email are solely those of the author and may not necessarily reflect the views or opinions of HCL or its affiliates. Any form of reproduction, dissemination, copying, disclosure, modification, distribution and / or publication of this message without the prior written consent of authorized representative of HCL is strictly prohibited. If you have received this email in error please delete it and notify the sender immediately. Before opening any email and/or attachments, please check them for viruses and other defects.
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

Show previous comments (1)
SG SG
saswat.gorkhali 6 years ago

    Hi SurveyJS Team,

    Please use the following link to test the functionality:
    https://rnluatwebapp1.azurewebsites.net/PH

    I have an alert set up on the OnComplete event to display “OnComplete Executed”. I have the same done for OnPartianSend event to display “OnPartialSend Executed”.

    In the link above, one of the Complete triggers is if Hire Date is after Event Date. So, if you select Hire Date to be 02-04-2019 and Event date to be 01-04-2019, the Complete trigger should execute on clicking Next. You will notice that you will get 2 alerts:

    1. “OnComplete Executed”
    2. “OnPartialSend Executed”

    Please note that there are other Complete triggers in the same page as well, so you might get the “OnComplete Executed” alert more than once.

    I am attaching the JSON file for the questionnaire.
    Also here are screenshots of the OnComplete and OnPartialSend code:

    Here are snippets of 2 custom functions I have added to the Function Factory that I am using for triggers:

    Please let me know if you need anything else from me. It would be great if you could look at this as soon as you can as this is affecting our production environment.

    Thanks,
    Saswat

      Hello,

      It's hard to debug the whole application on your site. I asked you to provide us with a minimal sample to reproduce and investigate the issue on our side. This will save your and our time to find out what causes the issue. I hope on your understanding.

      Thanks, Serge
      SurveyJS Team

      SG SG
      saswat.gorkhali 6 years ago

        Hi,

        Please use the following link to access a zip file that contains HTML and JS that you can use to test the error.

        https://drive.google.com/file/d/1kPBuAGVzcWnihYeXZfihAORXqhEtTbks/view?usp=sharing

        Please let me know if you need anything else from me.

        Thanks,
        Saswat

        Answers

        created 6 years ago

        Hello,

        Thank you for the sample you've provided.
        This indeed was a bug in our code. It has been fixed. Now onComplete fires only once in case of survey has been completed and onPartialSend fires in case of page has been changed.

        Thanks, Serge
        SurveyJS Team

          Show previous comments (2)
          SG SG
          saswat.gorkhali 6 years ago

            Is there any way you could do it sooner? This is affecting our production environment. Thanks!

              I think we will release the update this week after fix currently active bugs.

              Thanks, Serge
              SurveyJS Team

              SG SG
              saswat.gorkhali 6 years ago

                Thank you!