.



Core Functions    
Macros

Macros - saving complex queries

You can save complicated query routines for re-use.

Once you have input some criteria into a More Choice page you can choose 'Save Criteria ...' (<Command-4>/) on the Functions menu to take a copy of what you typed. You are asked to allocate a name to the set of query criteria to be saved. They are saved as a single record in the macros file. The criteria are saved in the macro Text field, while the Code allocated is the name you entered to the dialogue box with a prefix of © + the File Number, for example ©002 for the Companies More Choices.

An example might therefore be ‘©002London’ for a query to find all Companies in London. Since the macro Code is 15 characters long and the prefix is 4 characters long, you are limited to 11 characters for the name, and a warning message will tell you of any abbreviation required. Do not include the wildcard as the last character of your name. The name last used is remembered while you are in a given More Choices screen. If you use an existing name, you are asked ‘Do you want to Replace Criteria saved with the same name?’. Remember that you may re-use names if they are for different files, as the prefix will alter. The Person who created the query criteria is saved into the macros file for reference.

When you choose 'Load Criteria ...' (<Command-5>/), Enterprise 6 will bring back the details as saved, overwriting any query criteria that had already been typed. You are shown a window asking you to 'Load Criteria named ...' Type in part or all of the name you require, not including the prefix. If more than one set of query criteria is found, you will be asked to select the desired option from a list. This list will show the name including the prefix, and the originating Person. You can of course bring up a list of all saved query criteria for a given file simply by typing “@” or its equivalent.

Note that the saved query criteria record only the values typed into the current, frontmost More Choices window. They do not record the multiple levels that can be obtained through using either the And/Or/Not Functions or the Cross-file Find options. One therefore needs to record a set of query criteria for each of these levels.

Saving the query criteria in the macros file ensures that they are available to all users on all client machines. You do not have to have access to macros to make use of these functions, but if you do, you can use the macro editing features to view, delete or even edit the text of the criteria. They are saved in the macro recording text field, with the separate field values separated by Tabs. Be careful to maintain the same number of Tabs in the Text when you save any editing, otherwise the results could be unpredictable. The order that the fields appear in the text field is not necessarily that of the More Choices screen, and no labels are used to show you which is which. In other words editing the query criteria should be done with care.

You can also use this feature within recorded or created macros, as the saved macro record can be called from other macros. You can therefore automate not just the query itself, but the whole query procedure and attach it to a Function key if it is one you use often. You may want to build up a 'library' of saved query criteria before proceeding to record your macros, because you can then simply record going to More Choices, pressing <Command-5>/, typing the name of the criteria and pressing <Return> - thus skipping the need to record the typing in of the criteria into the macro itself.

Note that it is possible that amendments to the More Choices screens in future versions of Enterprise 6 might render your saved query criteria incompatible for certain files. If this does happen, you will be warned on updating that the query criteria records will be deleted. It is also worth noting that the saving and retrieval of File State bullets (for example in the Orders More Choices) is based upon the File States’ listing names. This means that if a File State has been inserted or deleted, the bullets will continue to be loaded properly, but if a File State’s listing name is altered, the bullets will not appear when loading criteria saved prior to the change.



 

Published date: v1.1.1.1 Fri, 09 Mar 2007 12:53:59 GMT

© 2006 - 2007 Daybook Limited, All trademarks accepted. All Rights Reserved!
Site Index