CDX Extensibility D365 MPOS


CDX Extensibility D365 MPOS



In one of our projects, we have a requirement to Add few fields to the customer group table and sync these fields with the MPOS channel database.

To fulfill this requirement we were following this link




Lets Begin


Step-1 
Create New straight table SLD_CustGroup and the same table we created in the Channel database as well.


Step-2 
Take Insert and update post handler of Cust group and perform insert and update on new table like below screenshot.










Step-3 
Create a new resource file to add all custom job information. Here is the template for the resource file and save it on any path.

<RetailCdxSeedData ChannelDBMajorVersion="7" ChannelDBSchema="ext" Name="AX7">
  <Subjobs>
    <Subjob Id="SLD_CustGroup" TargetTableSchema="ext" AxTableName="SLD_CustGroup" IsUpload="false">
      <ScheduledByJobs>
        <ScheduledByJob>1010</ScheduledByJob>
        <!--add existing sub-job to another job-->
      </ScheduledByJobs>
      <AxFields>
        <Field Name="CustGroup"/>
        <Field Name="SLD_PurchaseLimit"/>
        <Field Name="SLD_AllowSale"/>
        <Field Name="RecId"/>
      </AxFields>
    </Subjob>
  </Subjobs>
</RetailCdxSeedData>



Following is some information about tags of XML. You can find the detail on this Link

  • ChannelDBSchema – The extension schema that you created in the channel database.
  • TargetTableSchema – The extension schema that you created in the channel database to add your custom tables.
  • AxTableName – The table name.
  • IsUpload – A flag that determines whether the job is a rush job or a pull job. (In other words, the flag indicates whether you want to send data from Retail HQ to the channel database or pull data from the channel database to Retail HQ). The default value is false, which indicates that you're sending data from Retail HQ to the channel database.
  • ScheduledByJob – This resource file contains one or more sub-jobs.
  • Subjob – Each table is added as a sub-job, and each sub-job is scheduled by one or more scheduler jobs.
  • TargetTable – The name of the channel database table. This table is the target table that the push job or pull job must send data to. If a value isn't specified, the system assumes that name of the target table and the name of the source table are the same.

Step-4 Add a new resource file and associate the XML file with 







Step-5
Subscribe to the Delegate registerCDXSeedDataExtension of RetailCDXSeedDataBase in the new class and write the following code to load your newly created Resource file.


Add the resource like below 
For Example
   resources.addEnd(resourceStr(RetailCDXSeedData_CustGroup));

Step-6 
Now perform the build complete model and Sync database.

Step-7
To initialize or reinitialize the CDX module with the customized configuration, follow these steps:
  1. Go to Retail > Headquarters setup > Retail scheduler > Scheduler jobs > Initialize retail scheduler.
  2. In the dialog box that appears, select Delete existing configuration.
  3. Select OK to start the initialization.
    When the initialization is completed, the CDX scheduler jobs, sub-job definitions, and distribution schedules are updated by using the original RetailCDXSeedDataAX7 resource and the customized RetailCDXSeedData_CustGroup resource.

Step-8
For Verification search Scheduler jobs in AX and search bar job 1010.  You will find the sub job please check the below screenshot.



Step-9
Click on Sub job to verify that fields are appearing or not.


Feel free to contact me if you are facing any issues.


2 comments:

  1. Hi, The CDX is not working when extending the RetailTransactionTable. Created new extension tables with new fields and CDX xml references this new table. All looks good, only works if there is a record present in both ax.RetailTransactionTable and ext.RetailTransactionTable(new). Does not work if records(like logOn, LogOff) exist only in ax.RetailTransactionTable.

    ReplyDelete

Virtual Fields Vs Computed Fields

  Virtual Field: A virtual field in D365FO is a field that doesn't have a direct representation in the database. It's a field that y...