Run IDEA Script

2 posts / 0 new
Last post
Joined: 12/28/2015 - 05:39
Run IDEA Script

Dear All,
Hi I am Nilesh from India. I have small query regarding script command for running the IDEA script.
 For e.g. I have several IDEA scripts separately for
1.    Duplicate invoice booking
2.    Duplicate GRN
3.    Invoices more than 1lakhs etc..
Here I have provided user for Input dialog box where user can tick or dot perticuler tests
Then it will run only that test and not all
To make simplify I have created around 30 script at one location and don’t want to combine into one it should be separate scripts.
In one of tool there is command as     DO abc script   that means based on condition satisfied the abc script will run only.
Here in IDEA what is the command to run particular script

Brian Element's picture
Brian Element
Joined: 07/11/2012 - 19:57

Hi Nilesh,

I have created a small example that will hopefully help you out.  I have attached the code to the message.  What I have done is created a dialog that lists all the tests, in this example I have five tests.  Once the user clicks on OK from the dialog I have a boolean array that captures what the user entered and then based on if they have selected a certain test I will then run it.

In this simple example I just named all my tests Test 1.iss, Test 2.iss and so on so I could use a loop to go through each one, but if yours are all named differently then you will have to test each check box to see if it is selected with an if statement.  All the tests do is simply show a message box indicating that they have been selected.

Here is the sample code, let me know if you have any questions on this: 

Option Explicit
Dim bTests(4) As Boolean

Sub Main
	Dim dlg As NewDialog
	Dim button As Integer
	Dim i As Integer
	Dim sFilename
	button = Dialog(dlg)
	If button = -1 Then 'ok button
		bTests(0) = dlg.CheckBox1
		bTests(1) = dlg.CheckBox2
		bTests(2) = dlg.CheckBox3
		bTests(3) = dlg.CheckBox4
		bTests(4) = dlg.CheckBox5
	End If
	For i = 0 To 4
		If bTests(i) Then
			sFilename = "Test " & (i + 1) & ".iss"
			client.RunIDEAScript "Macros.ILB\" & sFilename			
		End If
	Next i

End Sub