When the xTuple Connect package is enabled, a SCHEDULE button appears on the MetaSQL Statements screen. This allows you to submit any of the shared MetaSQL statements to the xTuple Connect Batch Manager. Follow these steps to do so:
Follow this path:
Select a MetaSQL statement from the list
Click the SCHEDULE button
The screen should look similar to this:
Set the type and value of each of the parameters in the list in turn (see Section 7.3.1.1, “Active vs. Inactive MetaSQL Parameters”):
Select a parameter from the list at the top of the Review EDI Before Sending screen
Click the EDIT button
The screen should now look like this:
Choose an appropriate data type from the "Type" list. This will help ensure that the value you enter is valid
Click the "Active" box if you want to send it to the MetaSQL statement
You usually want the parameter to be active. See Section 7.3.1.1, “Active vs. Inactive MetaSQL Parameters” for details.
Enter the desired value for the parameter
Click the ACCEPT button
Many MetaSQL statements are written to behave in special ways if specific parameters are active or not. For example, many screens let you choose to see Items with all Class Codes, just some Class Codes, or a particular Class Code. These work by having queries that check whether certain MetaSQL parameters are active or not:
SELECT ... FROM item, ... WHERE ... <? if exists("classcode_id") ?> AND (item_classcode_id=<? value("classcode_id") ?>) <? elseif exists("classcode_pattern") ?> AND (item_classcode_id IN (SELECT classcode_id FROM classcode WHERE (classcode_code ~ <? value("classcode_pattern") ?>))) <? endif ?> ...
In this example, when the user selects a particular Class Code, the screen makes the classcode_id
parameter active. The query then looks only at items with the selected Class Code. If the user enters a Pattern, then the screen makes the classcode_pattern
parameter active and all Items with Class Codes matching that pattern are displayed. If neither classcode_id
nor classcode_pattern
is active, there is no comparison with any Class Code and so all Class Codes are displayed.
If you are not going to make a MetaSQL Parameter active, you do not need to set the type or value for it before submitting the MetaSQL Statement to the xTuple Connect Batch Manager.
The EDI Profile used by the SCHEDULE button on the MetaSQL Statements screen is fixed—it always uses the Profile xTupleMetaSQLEmail
. This profile has the following properties by default:
It always sends email
The email gets sent to the email address of the user who clicked the SCHEDULE button
The user is given a chance to review the EDI before it is submitted, which is required so the user can set values for the MetaSQL Parameters
The output is in CSV format
Submitting MetaSQL statements to the xTuple Connect Batch Manager always uses the xTupleMetaSQLEmail
profile. You can edit this profile, but be aware that it may change in future releases and your edits will be lost. By default this profile sends email to the xTuple ERP user who submits the job.