Batch Numbers of the items are not synced with the POS database, I need to sync all the batch number of the retail items when product job is run. Basically I need to sync INVENTBATCH table from AX to POS database.
In retail we have majorly 3 types of tables:
- crt (commerce run time)
Tables which has ax prefix are used to sync data from AX. If you navigate INVENTBATCH table in POS db you can see the dbo type INVENTBATCH is available, to sync this INVENTBATCH create table from script by replacing [dbo] to [ax] as shown below:
after running the above script you will see the POS db has 2 INVENTBATCH one of type ax and other is of dbo. ax.INVENTBATCH will be used to sync data from ax and dbo is used to safe the transactional data in it.
After the table is created in the POS db, connect the newly created table from Ax by creating the new scheduler subjob (Retail -> Setup -> Retail scheduler -> Scheduler subjobs) of INVENTBATCH:
when the new subjob is created for the table the “Channel table name” will not get the ax.INVENTBATCH table name to get the name view detail the dropdown and create the new channel table in the AX 2012 R3 table list:
After creating the table name with the name given in POS db provide all the Location fields of the respective Table:
once the location fields are defined, go back on the scheduler subjobs and select the ax.INVENTBATCH from the dropdown list and in the Microsoft Dynamics AX table name field select the corresponding AX table and click on transfer field list button to map the field list of AX to POS table:
when you click on the Match fields it will automatically create a related table field mapping as shown above and also it will create the method in the RetailCDXChannedSpecificData_AX63 class for InventBatch as shown:
you need to add the code on the RetailCDXXmlDataOutput_AX63 class. This class is used by the jobs to transfer the respective subjobs data, in my case I m using AX R3 schema that’s why I m using _AX63 extended class to get the INVENTBATCH :
Once done with the code, update the “Retail channel schema” (Retail -> Setup -> Retail scheduler -> Retail channel schema). In my case AX2012 R3:
select all and paste the table distribution to the notepad and add the following line to link the InventBatch table to its respective Item
Step # 3:
Add the InventBatch Subjob to product job (Retail -> Setup -> Retail Scheduler -> Scheduler jobs ):
after the subjob is added on the products job run the Products job on the respective store and navigate the data on the SQL on the ax.INVENTBATCH table data must be populated after the job is succesfully applied from download sessions.
Happy Daxing with Rizz 🙂