Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
Contents
Overview ....................................................................................................................................................... 2 Important concepts....................................................................................................................................... 2 Basic general concepts .............................................................................................................................. 2 A-job specific concepts ............................................................................................................................. 2 Data-area specific data transfer from AX to channel ............................................................................... 2 Channel specific data transfer from AX to channel .................................................................................. 2 Table distribution configuration overview ............................................................................................... 3 Incremental data transfer ......................................................................................................................... 4 Bi-directional data transfer ....................................................................................................................... 4 Synchronizing updates .............................................................................................................................. 4 Assumptions in this document ..................................................................................................................... 4 Synchronize using N jobs .............................................................................................................................. 5 Add to schema .......................................................................................................................................... 5 Define sub-job ........................................................................................................................................... 5 Add sub-job to job..................................................................................................................................... 5 Synchronize using A jobs............................................................................................................................... 5 Creating pre-actions.................................................................................................................................. 5 Add to filter by action creations ............................................................................................................... 6 Add to table-distribution configuration .................................................................................................... 7 Add to schema .......................................................................................................................................... 8 Define sub-job ........................................................................................................................................... 8 Add sub-job to job..................................................................................................................................... 8 Synchronize using P jobs ............................................................................................................................... 8 Prepare table for uploads ......................................................................................................................... 8 Incorporate ReplicationCounter, an auto-increment column in the table in channel ......................... 8 Implement maxReplicationCounterFromOrigin ................................................................................... 8 Add to schema .......................................................................................................................................... 8 Define sub-job ........................................................................................................................................... 8
Overview
Commerce Data Exchange provides three different modes of synchronizing data between AX and the Commerce Runtime database (CRT). It is important to understand the difference between them. 1. N-jobs N stands for Normal. These schedules are designed for performing fast bulk copying of data from AX to the channel database. For each synchronization of an included table, the corresponding table in the destination database is completely wiped before writing data received from AX. 2. A-jobs A stands for Action. These schedules are designed for performing incremental synchronization of data from AX to the channel database. More importantly, they also perform channel specific data transfer (discussed in more detail below). 3. P-jobs P stands for Pull. These schedules are designed for pulling data from the channel database into AX. Typically, these jobs are used for bringing transactions and orders into AX.
Important concepts
Basic general concepts
Sub-job Captures information about a single table to be synchronized Job Captures information about a set of Sub-jobs to be synchronized Distribution location Captures information about a data distribution target Location list Captures information about a set of distribution locations Schedule Captures information about synchronization of a set of location lists to a set of jobs
This can be best understood with an example. Notice the selected node, InventTable the table that contains the basic item information. Its configuration expresses that whenever theres a row inserted, updated or deleted in InventTable, perform the same action on the related rows in InventTableModule the table that contains the price information for items. InventTable by itself doesnt have a direct way to express which channel should an item be sent to. That relation is modelled in the design as a link between InventTable RetailAssortmentExploded
RetailPubRetailChannelTable RetailPubRetailOnlineChannelTable RetailConnDistributionLocation. The last one, RetailConnDistributionLocation represents a destination database. Therefore, the same relationship is expressed in table-distribution configuration. Now whenever theres a change in InventTable: 1. We traverse down starting at InventTable in the table-distribution tree trying to figure out which other data needs to be sent. 2. We traverse up till we reach RetailConnDistributionLocation to figure out which databases need all these changes to be sent to. That said, A jobs can be used without table-distribution. Table-distribution configuration can be deleted from the user-interface. The result is that A jobs would perform incremental synchronization of data, but not location specific data transfer, nor related data transfer. The reason for this should be obvious from the above paragraph. Without table-distribution, CDX doesnt know how to resolve a change to a location, nor what rows from other tables need to be replicated with the original change.
Synchronizing updates
Supported by: N and A jobs. Not by P jobs. Details: P jobs do not support synchronizing updates from the channel distribution location to AX. P jobs are designed to perform fast bulk inserts only.
Define sub-job
1. Click Retail > Setup > Retail scheduler > Scheduler subjob. 2. Click New to create a new subjob, or select the subjob that you want to modify. a. Make sure Replication method is Normal. 3. Complete the information in the Scheduler subjob form. You can also copy the settings of an existing subjob to a new subjob. For help completing the form, open the form, and then press F1. Note You can assign a subjob to more than one job.
{ replicate = RetailConnActionManagement::shouldReplicate(this, this.orig(), false); } ttsbegin; super(); if (replicate) { RetailConnActionManagement::createActions(this, RetailConnActionUpdate::Insert); } ttscommit; }
3. Enter the names of all the fields whose updates should cause a pre-action to be captured in the Fields pane.
Add to schema
Same as N job.
Define sub-job
Same as N job, except by actions as replication-method.
Implement maxReplicationCounterFromOrigin
AX uses the maxReplicationCounterFromOrigin method to determine the largest value received from the channel for records in a specific table from a specific location. The field mappings for the sub-job should be set up such that values in ReplicationCounter column in the table in the channel database end up in ReplicationCounterFromOrigin column in the corresponding table in AX database. Example implementation:
public RetailReplicationCounter maxReplicationCounterFromOrigin(RetailConnDistributionLocationId _locationId) { RetailTransactionTaxTrans taxTransTable; RetailTerminalTable terminalTable; if (_locationId) { select maxOf(ReplicationCounterFromOrigin) from taxTransTable where taxTransTable.Origin == _locationId; return taxTransTable.replicationCounterFromOrigin; } return taxTransTable.ReplicationCounterFromOrigin; }
Add to schema
Same as N job.
Define sub-job
Same as N job. Check Pull data.