hi all,
please let me know the xRecord class and common class . i saw the classes are used in stnd. code.
please let me know what is the different between both classes? and when to use?
i refereed this,but not clear
please elaborate me
hi all,
please let me know the xRecord class and common class . i saw the classes are used in stnd. code.
please let me know what is the different between both classes? and when to use?
i refereed this,but not clear
please elaborate me
If you are looking for example , you can find plenty of examples in the application if you do metadata search, one such a example you can check is from application class log inert method. There are plenty of methods on the same class which uses common.
Hi @rp@n,
The link you see is a bit old, you can combine to look at this system table https://docs.microsoft.com/en-us/dynamics365/fin-ops-core/dev-itpro/dev-ref/system-tables#del_companydomainlist
you will find:
The Common table is the base class for all tables. It does not contain any data. It is primarily used in X++ code to refer to any table in a polymorphic way.
Inheritance Hierarchy of Common table is xRecord Class Common Table.
The inheritance Hierarchy of all other system tables is xRecord Class Common Table (othertablename) Table.
I assume you mean "ID" instead if "I'd" and "right" instead of "rite".
If you mean that you can have a method accepting a record of any table (by declaring the parameter as Common), than it's correct. If you know a little bit about object-oriented programming, it should be very familiar.
Not really.
Nikoloas,
Some time we don't know the table I'd or field I'd if any tables. So, with help of common , we can pass the parameters of table I'd and get the value of ( recid ) of actual table. Then we can manipulate that table as per requirement.
Is it rite?
That's surely not standard code. It's seems to be a job and the code doesn't do anything useful. We can't explain to you code that makes no sense.
Could you please use Rich text formatting - Insert - Code when you share your code?
Other than that, I don't have anything to add, except to read my previous messages.
Nikoloas,
static void DataDic_Common(Args _args)
{
Common common;
CustTable custTable;
;
common = custTable;
if (common.tableId == tablenum(custTable))
{
while select common
{
info(common.(fieldnum(custTable, name)));
}
}
}
Let me know why common is used? We can loop directly CustTable rite?
I already gave you an example in my first reply.
Since you said that you found standard code where Common is used, perhaps you can go where you saw it, and try to figure out how it works. And if you need our help in that, just let us know what code it was.
Thanks!
Nikolas,
Please give me an example of common table. So, that I can understand properly
André Arnaud de Cal... 291,711 Super User 2024 Season 2
Martin Dráb 230,458 Most Valuable Professional
nmaenpaa 101,156