Hi All,
Can you please let me know how "Common Table" been used ? Means how it's working practically.
Kindly give me an example.
Thanks!
*This post is locked for comments
There is no defined "criteria" to use it. It solely depends on your design.
If you think, a same Code block can be used for multiple tables, you can use it.
Thanks Crispin,
Now I understand. One things only.
Is there any specific criteria to use "Common Table" ? OR I can use anytime.
Please give me more shed on this.
Probably your question has to be rephrased, but I'm sure this will help better.
Consider Common as a parent of all tables. So you can assign all childs(tables) to the parent (Common), and otherway(with condition)
eg: common = custTable; will work without a condition
if (common.tableId == tableNum(CustTable))
custTable = common;
Suppose if I worked with VendTable then Common table hold the table id of Vend table and passed as a parameter.
basically it's (Common table) hold the table ids of all table in AX. correct ?
A very common use is in a Code that performs the same function for multiple tables. I'll explain this below, but look for more examples as Martin recommends..
Imagine a method that performs a certain function, and
void testCommon(Common _common)
{
Switch (_common.tableId)
case tableNum(CustTable):
// logic for custtable.
break;
case tableNum(VendTable):
// logic for Vendtable.
}
You can thus call the same method with different tables as Parameter, and perform corresponding functions. Is that clear?
You can find some information and examples by putting ax common table to a search engine. You can also use cross-references to find examples in AX.
Under review
Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.
As AI tools become more common, we’re introducing a Responsible AI Use…
We are honored to recognize Andrés Arias as our Community Spotlight honoree for…
These are the community rock stars!
Stay up to date on forum activity by subscribing.
Syed Haris Shah 9
Mea_ 4
Martin Dráb 2 Most Valuable Professional