Skip to main content

IDEAScript Questions

Testing against a variable inside an IF function

Hi Guys,

Has anyone found the solution to create an IF-function within IDEA to test something against a variable?

To be more precise, I was hoping to create a new field, which gives me the text "EMAIL" if the variable {JobDepartment} is defined as "EMAIL" or to give me the value in the column [JOB].

I have tried the below equation, but this one does not seem to work unfortunatelly:

Dim JobDepartment As String
JobDepartment = "EMAIL"

field.Equation = "@If(" & JobDepartment & " = ""EMAIL""; ""EMAIL""; JOB)"

Information from db.FieldStats.GetValue

Hello together,
in Germany we use the IDEA Client Version: 12.2 (v12.2.61.159).
I tried to use
db.FieldStats.GetValue(pos)
pos As Long
In the help-file there were some text-constants for "pos" like TotalDebit
But with db.FieldStats.GetValue(TotalDebit) I don't get a correct value.
How must I write the script to get the right information?

How to remove or replace quote marks in a text field

Hi Brian,

I hope all is well with you.

I've a problem with double quote marks " that I'm hoping you might be able to assist me with.

I've a macro analysing import declarations, and one of the things it does is fuzzy matching on goods descriptions.

It works great, but if the description field contains a double quote then the action field for that record will not work.

For example, on one line the text might be : 12" tubing

This quote mark appears to be confusing IDEA , as the action field always works except when the double quote appears.

Canceling a macro on error

I stack all my macros together and use a "master" macro to run them sequentially. It allows me to simplify and compartmentalize the code. The problem is if I get an error. The code continues to run from the master program. Any suggestions on how to stop it? Below is a snippet of the macro that runs the other macros.

Thanks,
Randy
ProjectLocation = Client.WorkingDirectory()

Use Extraction with XXL-Criteria

Hi!
I want to create a script that extracts a table with a consistent field structure based on a key.
The user selects the keyvalues from a list that should be excluded during extraction.
This selection is temporarily stored in an array of string.
For l = 0 To UBound(asSelected)
sAcct = iSplit(asSelectedGewaehlte(l),""," - ",1)
If sCrit <> "" Then
sCrit = sCrit & " .AND. ACCT<>" & Chr(34) & sAcct & Chr(34)
Else
sCrit = "ACCT<>" & Chr(34) & sAcct & Chr(34)

Calling a script within a script

Hi Brian,

I hope all is well with you.

I'm trying to combine two scripts as follows:

Script A is a standalone that is used regularly.

Script B will not be used often, and it's starting point is the final file produced by Script A. It is not standalone.

I will need to update Script A from time and therefore I think it is better to call it at the beginning of Script B.

(I think this is sensible, as if I paste it into the start of Script B then I would have two files to update).

I have this working fine, except for one problem.

Help importing multiple PDF files without naming them applying a tfm template and then appending them

Hey! I have many pdf files named differently. I’d like to find a way to loop through all of them without having to name each of them individually (there are too many of them) and then append them all. I already saw Bryan’s post about how to sort of do this but I’d have to name each file and since I have like fifty of them, I’d like to find a quicker way to do it without naming each of them.

Thanks!