|
Go
![]() |
New
![]() |
Find
![]() |
Notify
![]() |
Tools
![]() |
Reply
![]() |
|
Hi, sorry about all the posts but I'm trying to write quite a complicated script. It's to retrieve monthly stats from our database and part of it is this:
function sala_onClick() { Form.boxes("cc2").content = "Chief Executive"; Form.boxes("offloc").content = "County Hall"; Form.boxes("date").content = "@date-30 : @date"; Command.selectFormsEx("","","RETRIEVE HISTORY",""); Command.executeQuery(); } I now want to write another script but this time to find items NOT stored at County Hall but Form.boxes("offloc").content = "! County Hall"; doesn't work and nor does the work round "* ! County Hall" Is there any way to do this without having the NOT box selected? There are far to many variables to list in this box so it really needs to be a NOT option. Thanks for your help! |
|||
|
I have a database with that type of scripts and just altered a search menu and put in a new script to test the function:
function TI_onClick() { Command.newQuery(); Form.boxes("Title").content = "* ! ABB review"; Command.selectFormsEx("Storage and arrivals",".Ankomstreg","Ankomst visning","Cirkulation"); Command.executeQuery(); Command.refreshWindow(); } In my case "Title" is your "offloc". And I have a journal called "ABB review" in the "Title"-field. This script functions. I get all journals except ABB review. This means I think your script part Form.boxes("offloc").content = "! County Hall"; should function. Are you shure all other things in the script are right? NEEngstrom |
||||
|
The first thing in a query box cannot be a search symbol (&/!). That's the difference between NEEngstrom's search that works:
"* ! ABB review" And AT's that doesn't: "! County Hall" You'll need to either change your box contents to be the following (which would be a pretty inefficient search): "* ! County Hall" Or, use your script to change the state of the AND/OR/NOT button and put just "County Hall" inside the query box. Sample JavaScript Script 11 in the DB/TextWorks (or CS/TextWorks) help describes how to do this, except that you'd use the box name instead of using a loop with the box number: Form.boxes("offloc").booleanValue = Form.boxes("offloc").BooleanNOT; |
||||
|
Thanks NEEngström and CDale!
I had already tried the "* ! County Hall" and found it took ages to run! Forcing the box to be a NOT box in the query is working fine so far (touch wood) so many, many thanks! Amber |
||||
|
| Previous Topic | Next Topic | powered by eve community |
| Please Wait. Your request is being processed... |
|

