Using Inside Sesame's PostWiz Posting makes permanent
changes to the TARGET database What PostWiz Does Sesame doesn't come with Q&A for DOS-style batch posting, so Inside Sesame Labs created PostWiz to fill the gap. In an easy-to-use pop-up wizard, PostWiz helps you quickly create, save and run batch posting specs that mimic Q&A's Post feature — complete with the ability to run target database calc statements with each post. PostWiz can also generate portable drop-in posting programs from your posting specs. You can pop-up the wizard from any form in any Sesame application to run your routine posting tasks, or have PostWiz generate posting programs you can paste into your own command buttons. It can even post between external applications. Setting Up PostWiz PostWiz is supplied as a small Sesame application. You simply merge it into your existing application in Sesame Designer (Application / Merge Application). Then, on your application's main menu or in any form, you add a button named "Batch Posting" or "PostWiz" and program its On Element Entry event with just the two lines shown below. You're ready to start posting.
PostWiz supports a variety of user mode startup parameters. Creating PostWiz Posting Specs Œ
Starting PostWiz To select different source and target applications, click the folder icons to the right of these dropdowns. (PostWiz is easiest to use when both databases involved in a posting operation are in the same application as PostWiz.) When starting PostWiz, if you've saved any posting specs, they will appear on the Saved Specs dropdown. You can select a saved spec and click the Load button to load it. When modifying a saved spec, be sure to click Populate Dropdowns because PostWiz does not save these lists with the spec. (New fields could have been added to the Source or Target database after the spec was last saved.)
Source DB (Post From) / Target DB
(Post To)
Like Q&A, PostWiz posts to the first matching record.
When you've specified the post to be performed, click the Add This
Post to Posting Transactions button. The post will appear on the Posting Transactions list. Ž
Source DB Retrieve Spec Select an AND or OR search for the SOURCE records.
Select the fieldname from the Field dropdown, then type a restriction for it in the adjacent Spec field. Up to four fields/restrictions can be specified. Here are a few examples of SOURCE database retrieval restrictions:
Additional Source Retrieve Options Field1: InvoiceDate [D] Spec1: >=2010/01/01 Field2: InvoiceDate [D] Spec2: <2010/02/01 Or, you can use a date range shortcut that requires just one Field/Spec. Here's one that specifies the Source records whose contract date falls in the fourth quarter of 2009: Field1: Contract_Date [D] Spec1: 2009/10/01..2009/12/31 Simple valid retrieve expressions may also be used as long as they do not reference any fields. For example, Source records with today's date in the Order_Date field: Field1: Order_Date [D] Spec1: {@Date} Source records more than 30 days old with a balance due (using an 'AND' search): Field1: InvoiceDate [D] Spec1: <{@Date-30} Field2: Balance Spec2: >0 Runtime Prompt Options
For example, to retrieve a date range of Source records (this month to date, last month, current quarter to date, or whatever, you can use the Prompt for Date Range option. When you select any of the prompt options, PostWiz will ask you (1) which field it's for among those already specified (2) the parameter (greater than, lesser than, etc.) then (3) display a dialog for you to enter a brief runtime instruction so that the user knows what he or she is expected to provide. In the case of a Date Range, two dialogs will display, one each for the starting and ending @Calendar prompts. If your Source record retrieval parameters are more complex than PostWiz supports, you can always use the Code Builder to output a starting program, then modify it to suit. Remember that XResultSetSearch(), which PostWiz uses, does not support combination AND / OR searches. You must use one or the other. AND is the default.
Test your Retrieve spec using the Test Spec button. (This does not run a post; it only counts the Source DB records that met your restrictions.) If the count doesn't look like what it should be, do a manual retrieve in the Source DB itself (using the same restrictions) to confirm the total record count. Optional Target DB Calc Program Using the Code Builder Running a Post Like Mass Updates, posting specs are best run when nobody is in the Target database. If, during a post, a Target DB record is in use (locked), PostWiz will be unable to post to it. Optional PostWiz startup parameters To control what users can do with PostWiz, you can specify optional user mode startup parameters: var vLetsPost as String The table below describes what the four PostWiz startup parameters do.
Example 1 Loads the saved spec named pwz_My Posting Spec. Disables everything except the Run Post button. Automatically closes PostWiz when the posting has been completed. User initiates post. Example 2 Example 3 You can control who has access to PostWiz with a conditional like the following:
For "normal" or "admin" mode, do not use (or comment out) the ClientLocalValue() PostWiz does not store any data or return anything required by the calling program. When you create and save a posting spec, PostWiz saves it in an external file named pwz_[specname].pwz in your Sesame working directory. Specs can be tested, modified, resaved and, of course, run. |