Kaseya Community

Help with a yes/no dialog box

  • Hello,

    I'm working on an agent procedure were a Yes/No box is presented, and if the "yes" option is chosen, then I would like the agent procedure being called to present a prompt to go to a variable. Currently, I have one agent procedure (Procedure1) that presents the "If isYesFromUser" and if the "yes" button is chosen, then it calls another agent procedure (Procedure2). Procedure2 then is suppose to prompt for a user's response, and then move on. Unfortunatley, it does not work that way. If I run Procedure1, I almost automatically get a prompt for the user interaction from Procedure2, and I never get the yes/no dialog box.

    In troubleshooting, I have tried adding a pause(s) in both procedures. I have also tried to remove the variable that prompts for a user response, and then it appears that the yes/no dialog box works without a problem. I have studied the reboot script with the yes/no dialog box, and tried to copy the yes/no dialog box from that procedure, and it doesn't make any difference.

    I would love to see if anyone has any ideas on how I may be able to either get this script working, or maybe another take on how to accomplish close to the same thing.

    Thanks!

  • Hello CLLNCYR4,

    To make it easier for you, how about placing all the prompts in the first procedure and call the other procedures with all "prompts" already resolved?
    In this example I have Example2 procedure that prompts a Yes or No and in case of a Yes, it prompts a second time.

    All results end up in a "temporary registry location" that can be read from the called procedure as shown by Example1 procedure.

    You can also use Universal Variables if you like (their scope goes across procedures), or other ways to exchange prompt results.

    Procedure Example1.xml8422.Procedure Example2.xml

    Note that Example2 procedures also takes care of setting the second variable as "undefined" in case you run the procedure a second time on the same agent and the user choose No in the first prompt (in which case you don't want to leave the second variable with a value coming from the first execution of the procedure).

    In alternative you could also remove all the temporary keys after the procedure executes anyway you get the idea.


    Best Regards

  • Hello Alessandro,

    Thank you for your reply. I will review the procedures to see if this will work for me.

    -C