Hi Brian,
I have created an extraction in IDEA. My task now is to automate it by creating a menu / dialog box for the user. How am I able to trigger a pushbutton and display the direct extraction result via IDEAScript. Example, I have a pushbutton called 'A'. If 'A' button is pushed, the extraction result will be displayed. Same goes with button 'B', 'C' and so on. Should I also put a Do..Until / Select..Case loop in this situation.
Any help with sample scripts would be great here.
Thanks.
William
William Yong
Offline
Last seen: 7 years 1 week ago
Joined: 06/30/2014 - 00:37
Hi William,
Here is some sample code for you (you can download it here if you want). The script has three buttons, the buttons are numbered based on the order that they are created and 0 is the cancel button and -1 is the ok button. In the example script the menu is displayed until you hit the ok or the cancel button. When you hit a button the script will give you a message box saying which button was selected. So let me know if this is what you are looking for or give me more info and I will try and help you out.
Hi Brian,
Thanks for sharing the codes. It works fine. However, I required an action and not just message box when the 1st button is clicked. In my case, I required the 1st button to help me generate the details from the database upon clicked. I included these below statements in after the 1st Select..Case message box. I received a 'syntax error' here. Any idea on how to rectify this error?
DirectExtraction = TRUE
GoTo DirectExtraction
I also try put the Client.RunIDEAScript "C:\xxxx.iss" after each Select..Case messagebox. It also return an error message to me.
Please help me solve the error message encountered.
Cheers,
William
Hi William, you should be using a call and not a goto.
So change Goto DirectExtraction to Call DirectExtraction and it should work. Goto allows you to jump to another point in your function and you need a Goto: - with the colon to work, so the GoTo function is looking for the Goto: to jump to, since it is not finding it it raises an error.
I am not sure on the Client.RunIDEAScript error, I will have to test it out and get back to you.
William, for the Client.RunIDEAScript make sure that the link is good. You will get an error if you have a spelling mistake or the link is not good.
Hi Brian,
Thanks for the advice. I try both Call function and Client.RunIDEAScript, and it works. However, in the end I still prefer the Call function as it uses less .iss script files. The task I'm currently working on is valid for only one particular day data. What if I would like to continue perform the extraction with another type of file/data from next day. How am I able to do that? I got a plan here. I would like user to:-
1. Browse the directory to refer the .jpm file (report reader file prepared & to be continuously use)
2. Allow user to create the IDEA database with the prepared .jpm file earlier
3. Back to the original script that allow user to click on the buttons and give different days of result.
How am I able to work out item 1 & 2 above. To assist better with the understanding, please refer to the attached screens for more info.
Thanks.
Hi William, here is some sample code. The menu I put together looks like this:
The script allows you to select the file to import, select the import definition and then select several audit steps to perform. You can find the code below and I have attached it so that you can look at it.
Hi William,
Just a suggestion. Could you not allow the user to select the daily file and then have the script import it? Also instead of using buttons could you not use check boxes so that the user would select which extractions to perform?
So you would have a menu with a button which would open up a load button, the user selects the file and then ticks off the items they want to perform on the file and then selects ok.
The script then imports the file and runs all the tests selected. Let me know if that would work for you and I will help you build the interface.
Brian
Hi Brian,
That sounds like a plan and workable too. Appreciate to share the code to me.
Have a nice day!
William
Just one last question, which version of IDEA are you running, the reason I ask is that IDEA added some additional functions for getting files in V9 and higher that are not available in V8. So if I create the demo using those items the script would crash in V8.
Thanks Brian,
The script works fine for me. Very kind of you to code it in both version, v.8 & v.9. I'm actually in v.8. I'm trying to improve the script by putting some error validation check on the file extention and file definition that user exported. What's the code like if I would like to allow user to import file definition in .jpm format only. I try to put the code here, but it got crash! Kindly assist and share some code to me.
Thanks in advance. Cheers, William
Pages