This dialog is used to set the controls for publishing system data. It affects the following commands:
- Publish to SQL Server: Publishing to a SQL Server requires that a connection string be identified on the “Extra Services” tab of the instance configuration manager.
- Publish to XML: This writes a file to the special Windows folder MyDocuments on the PC where the APS Extra Services service is running. If MyDocuments is not defined then it goes to the Windows folder CommonDocuments. In both cases, it’s written to a subfolder called “APS Export Files”.
- Publish to a Custom Program: A custom Microsoft .Net dll can be called directly from APS and passed an in-memory dataset of the entire Publish DataSet.
- Publish to Microsoft Project import tables in SQL Server: These can be used to populate a Microsoft Project file with the current schedule.
- Browse (accessed from the Jobs pane): This is to view an in-memory copy of the Publish data.
These settings affect all Scenarios for all Users.
The following settings are available:
Ask which resources to Publish when Publishing: This option allows the users to control what Resources are required for publishing. In the case of inactive Resources, or Resources serving as “dummies” it would be beneficial to leave them out of the publish since they are purposefully not reflecting a business reality.
- Publish activity scheduled to start in the next: Since published schedules are often used to update ERP databases, this usually needs to be set to a large value so that all jobs are updated in ERP system. This setting limits the data that is published in the following ways:
Jobs, Manufacturing Orders, Operations, and Activities that are scheduled and have a Scheduled Start that is after the Clock plus this amount are not published.
Purchases to Stocks that have a Scheduled Receipt date after the Clock plus this amount are not published.
- Run Stored Procedure after scenario publish: This field is used to define the stored procedure(s) to run after publish is performed.
These are the stored procedure parameter definitions for the stored procedure called after a Publish is performed:
UserDefinedParameter: This is a text parameter that can be used to pass information, like parameter strings, to the stored procedure.
PublishDate: The date/time that will be stored in the PublishDate field in the Schedules table of the APS database. This can be used in the stored procedure to only update records that were just published, as opposed to including records from previous publishes (only necessary if storing history).
Message: This is a return message that is displayed in the Log Viewer window if non-null.
Undo: This can be set to 1 to cause an undo of the last action. This is typically only used for the Net Change Publish thus enabling the stored procedure to validate the results of the schedule change and undo the change if necessary.
Example declarations in a stored procedure:
, @Message varchar(8000) = ” OUTPUT
, @Undo bit = -1 OUTPUT
Here is an example for a stored procedure called “APS_PutData_GP”:
@Message VARCHAR(8000) = ” OUTPUT,
@Undo BIT = -1 OUTPUT
On the Procedures tab of the Scenario Publish Options pop-up window, I will pass the text “GP10_Test, APS_Publish” to the APS_PutData_GP routine via the @UserDefinedParameter by placing the string after the SQL Stored Procedure reference in the “Stored Procedure to Run after Publish (in import database)” box as follows:
- Run a Program after Publishing: If the check box “Run a Program after (full or net-change) Publish” is checked and a valid path of an executable file is specified, APS will run that program after publishing has been performed. This can be used to call a third party application or generate a report using the newly published data. Since the program specified is called by the APS.net Extra Services Windows service, the path to the file must be valid on the computer where APS.net Extra Services is installed and accessible by the service.
- Save Published Schedules for History: This can be used to store previously published schedules. This can be helpful for creating reports that compare changes in schedules over time or various What-If scenarios. If this is checked then previously published data is preserved subject to the various options below. Otherwise all tables are cleared prior to publishing the next set of data.
Delete activity scheduled to start beyond the next: This can be used to keep only “short term” schedule history. It is usually not necessary to store the entire schedule for old schedules. This can be used therefore to save disk space if the full schedule does not need to be archived. When a Scenario is published, previously published data is purged in the following way:
- Jobs, Manufacturing Orders, Operations, and Activities that were previously published and have a Scheduled Start that is after their Scenario’s Clock (at the time they were originally published) plus this amount are deleted.
- Purchases to Stocks that were previously published and have a Scheduled Receipt date that is after their Scenario’s Clock (at the time they were originally published) plus this amount are deleted.
Delete all History older than: This can be used to limit the number of schedules that are stored. If a schedule was published beyond this amount of time in the past then it is deleted when the next publish occurs.
Delete What-If History older than: This can be used to further limit the number of “What-If” schedules that are stored. If a “What-If” schedule was published beyond this amount of time in the past then it is deleted when the next publish occurs.
- Net Change Publish:
o Enable Net change publishing: By selecting this check box, APS will only publish the changes that have occurred since last publish.
o Run Stored procedure after Net-change publish: This field is used to specify what stored procedure if any should run after Net Change Publish.
Optional limitations for high-volume data: These options can be used to limit which data is published and kept in history. These types of objects tend to have very high volume (many records) and therefore consume a great deal of hard-drive space and extend the time it takes to perform the Publish. Each option has a “Publish” and “Keep History” option. The Publish option is to prevent (by un-checking) the data from being published. The “Keep History” option determines whether the data is kept when schedule history is being used.
- Warehouses, Inventory, and Demand: If checked, then the following objects are published: Warehouses, Inventories, Items, Purchases, Forecasts, Sales Orders, Transfer Orders, and Inventory Adjustments. This data can be very high volume and therefore require large amounts of hard drive space and time to publish.
- Activity Blocks and Intervals: Not to be confused with publishing back the Activities, the identifiers for the Activity Blocks from the Gantt themselves can be published back to the ERP. For example, if an Activity uses two Resources and spans two Capacity Intervals then this would result in two Activity Blocks (one for each Resource) and four Block Intervals (one for each Block and for each Interval).
- Capacity Intervals: This includes one record for each Recurring Capacity Interval and one record for each non-recurring Capacity Interval.
Activity Block Intervals: This limits the Intervals that are formed when a Block crosses an offline period on a Resource.