Button click executes the action twice

Ask your PowerShell-related questions, including questions on cmdlet development!
Forum rules
Do not post any licensing information in this forum.

Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
This topic is 6 years and 9 months old and has exceeded the time allowed for comments. Please begin a new topic or use the search feature to find a similar but newer topic.
Locked
User avatar
test3-eu
Posts: 1
Last visit: Mon Mar 14, 2022 2:11 am

Button click executes the action twice

Post by test3-eu »

1. Have a simple form which collects registry data from several computers
2. the output is stored in a CSV file.

Issue is, the action runs twice & ends up creating the duplicate values

in the attached file(UAT.psf), click on the button "Export-Image-Details"
the output is stored in c:\temp\UAT-Logs\....image

Expected output
action should run once & update the values only once
Attachments
Error-Report.png
Error-Report.png (156.17 KiB) Viewed 2076 times
UAT.psf
(542.21 KiB) Downloaded 134 times
jvierra
Posts: 15439
Last visit: Tue Nov 21, 2023 6:37 pm
Answers: 30
Has voted: 4 times
Been upvoted: 33 times

Re: Button click executes the action twice

Post by jvierra »

The best we can do is to suggest using the debugger to step through the code.

I recommend that you rethink using global variables as control items. In most cases that I see you do not need them.

Note that there is no way for us to run your code as it is totally dependent on your network.

The form is also a bit broken as controls are inside of controls and behind controls. Much of the form is hidden when displayed.
User avatar
davidc
Posts: 5913
Last visit: Mon Jul 08, 2019 8:55 am
Been upvoted: 2 times

Re: Button click executes the action twice

Post by davidc »

This article may help you:

http://info.sapien.com/index.php/guis/g ... ton-clicks

If it is a clicking issue.
David
SAPIEN Technologies, Inc.
This topic is 6 years and 9 months old and has exceeded the time allowed for comments. Please begin a new topic or use the search feature to find a similar but newer topic.
Locked