Comparing AX records and BYOD Records

Hi Experts,

I have a BYOD setup . I need to match the records count of AX original tables as well as BYOD (to verify record count between AX table and table for published entity in BYOD ).

I have written a code to count the records of AX tables those are involved in entity creation.

But now i need to count the records of BYOD published data. How can i proceed this? Is there any ways.

Please guide me the ways to contact Byod using X++.

Thanks in advance,
Mark.

Please add more information - it’s not clear where you need to access the information and when, if you want to count records for a particular ExecutionId and so on…

Hi Martin,

createing a runnable class that display the count off original(base tables of dataentity) tables for AX365FO and Byod db.

then we can match the count from AX365FO with byod.

Thanks,
Mark

Do you realize that there are many legitimate reasons for getting different numbers?

What you see in BYOD isn’t a copy of base tables - there are exports of data through data entities. That you have a certain number of records in a table doesn’t mean that you’ll get the same number in the data entity, because there may be joins and filters. You also need to think about DataAreaIds (and how you’ve configured the export). And timing (you may be running the check before latest changes got synced to BYOD). And so on.

I think you focus too much on code and too little on what you want to achieve. If you want our help with the design, please share business requirements with us.

Yes martin, I already count the records of base original tables (which has joins and Range set in data source) by writing X++ codes. Now i need to connect with byod db and count the published records.

Example:
Entity : ‘ProdtableEntity’ for this entity, base table is prodtable with some relations with inventable and ecoresprodtrans table. i have written a below code and found the record count of the table.

“select count(RecId) from prodtable
outer join inventtable
where prodtable.ItemId == inventtable.ItemId
outer join ecoresprodtrans
where inventtable.Product == ecoresprodtrans.Product;
info(strFmt(“ProdTable %1 records.”, prodtable.RecId));”

Now i need to know the published records count of “Prodtableentity” in Byod?

Thanks in advance,
Mark

What business problem do you hope to solve by this technical solution?

Your code is unncessarily complicated and it also duplicates what is already defined in the entity, which is bad for maintainability. You can use entities in select statements, such as: select count(Field) from MyEntity.

Furthermore, the joins are not needed in this case, because they’re outer joins.

Counting records in BYOD is also simple - you can use select count(*) from XyzStaging. in T-SQL. But if you get differences, it doens’t necessarily mean that anything is wrong (as discussed above), therefore the value of this information is questionable.

By the way, there is no ProdTableEntity in my application.