IDEAScript Questions
Testing against a variable inside an IF function
Forums
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)"
Direct Database Lookup
Forums
I am looking for a way to convert a series of joins to a direct lookup. That will give me more freedom with the scripting and eliminate a lot of extra code. I attached an Image that explains what I am trying to accomplish.
- Read more about Direct Database Lookup
- 3 comments
- Log in or register to post comments
Information from db.FieldStats.GetValue
Forums
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?
- Read more about Information from db.FieldStats.GetValue
- Log in or register to post comments
Extraction of specific entries
Forums
Hi,
I'm new to IDEA-Script and haven't been able to find a relevant post in the forum. I hope you can help me. I have a table with entries like these:
- Read more about Extraction of specific entries
- 8 comments
- Log in or register to post comments
How to remove or replace quote marks in a text field
Forums
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
Forums
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()
- Read more about Canceling a macro on error
- 2 comments
- Log in or register to post comments
Use Extraction with XXL-Criteria
Forums
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)
- Read more about Use Extraction with XXL-Criteria
- 2 comments
- Log in or register to post comments
Calling a script within a script
Forums
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.
- Read more about Calling a script within a script
- 5 comments
- Log in or register to post comments
Help importing multiple PDF files without naming them applying a tfm template and then appending them
Forums
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!
Adding Working Days to Date
Forums
I am trying to find a way to add working days to a month end date. Ultimately I want to figure out if a date in my database is greater than 4 business days from the end of the prior month. Does anyone have any tips on how I can do this? Thanks!
- Read more about Adding Working Days to Date
- 9 comments
- Log in or register to post comments