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.


Data Source Join Types D365FO & AX 2012


Data Source join types


Form data source link type is a property of the form data source. We can add more than one table as a data source to the form. Those data sources should have the table level relation, So, then the developer not need to work on the coding part to find the related records. For example, if we create the order form, that order form has Student and student Attendance tables as form data sources. We can make part of both tables of the form data source and can make links as per requirement.



For Instance, We Created Two Tables.


  • Student
  • Student Attendance


Then Create a relation as per your requirement. I am using Normal relations.

Student

Student Attendance





Now create New Form and Add two Gird [StudentGrid] & [StudentAttendanceGird]




Let's begin


Passive Join Type




Passive form data source link type won't update the child data source automatically. For example, if we select the parent table order then order details child data source won't update. If we need to update the child data source we need to call the child data source to execute the query method by the program (code).


Active Join Type




Active link type updates the child data sources without any delay when you select the parent table record. When you deal with more records it will affect application performance.

Delay Join Type



Delay form data source link type is also same as active method the different is delay method won't update immediately when you select the parent record. It will update the child data source when you select the parent table, Ax uses a pause statement before update the child data source. 


Inner join Type



Inner join form data source link type displays the rows that match with parent table and child table. 


Outer join Type


Outer join form data source link type will return all parent records and matched child records. It will return all rows in the parent table. 

Exists Join Type



Exist join form data source link type return matched rows of the parent table. It behaves like an inner join but the difference is once the parent row is matched with child records then stops the process and updates in the grid, Ax won't consider how many records are in the child table for the parent row.

Not Exists Join Type



Not exist join form data source link type is a totally opposite method to exist join. It will return the not-matched parent records with child records.






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...