When I got requirement to create another kind of transactions in Retail POS, e.g. planned order, and those data have to be pulled to Retail HQ for following processes.
RetailTransactionTable is a good example to start. These are some steps how I create a transaction table to support pulled data from Retail POS.
Create transaction table in Retail HQThe new table consists of Primary index with fields: Store, Terminal, Channel and TransactionId
In the transaction table, copy 2 methods from RetailTransactionTable: maxReplicationCounterFromOrigin and setMaxReplicationCounter. Change variables matching the new and temporary tables.
Create transaction table in Retail POS Store DBI simply generate create table SQL script from AX database. If transaction table has RecId field/index, delete it. Rename ReplicationCounterFromOrigin to ReplicationCounter with IDENTITY increment. Run the script in Store DB.
Configure Retail Channel SchemaIn Retail Channel Schema, read schema from Store DB to get new table and fields.
Open Scheduler subjobs, search for RetailTransactionTable.
- "Copy scheduler subjob" to create a new subjob. Change tables to new transaction. Temporary table is TableNameX.
- "Transfer field list" to map transferred fields (Functions > Match fields). Delete these fields (if there is); Origin, CreatedBy, CreatedDateTime, ModifiedBy, ModifiedDateTime, Partition, RecVersion. Add new field to match ReplicationCounter and ReplicationCounterFromOrigin
- "Create staging table" to generate the temporary table (TempDB type).
Run P-JobFinally, in Distribution Schedule, run the P-Job. The new table with Replication counter will show up.
This, I only explain about transaction tables. Next times, I will show about creating a simple transaction form in Retail POS.