AX / D365FO – How to get values of base enums using code in x++

static void getEnumValues(Args _args) { EnumId enumId = enumNum(LedgerDimensionType); //Put here your enum DictEnum dictEnum = new DictEnum(enumId); int numOfValues = dictEnum.values(); //This method gets the total number of enum values int counter; for(counter = 0; counter < numOfValues; counter ++) { //You can use the number of method exposed by DictEnum class Info(strFmt('%1',dictEnum.index2Value(counter))); Info(strFmt('%1',dictEnum.index2Symbol(counter))); … Continue reading AX / D365FO – How to get values of base enums using code in x++

AX / D365FO – Add CreatedOn, CreatedBy, ModifiedOn, ModifiedBy fields on a Table

Do you want to know when a table record has been created or modified? Or better know who has created it or modified it? You can do it by enabling these properties on a Table object : Created By = Yes Created date Time = Yes Modified By = Yes Modified Date Time = Yes … Continue reading AX / D365FO – Add CreatedOn, CreatedBy, ModifiedOn, ModifiedBy fields on a Table

AX / D365FO – How to Hide Enum values on a Form Lookup x++

Suppose you have a Form with an enum control ABC which contains values A,B,C. you want to hide last value of enum "C" while displaying it on the form. You have 2 ways to reach the result : Override the "Run" method in your Form (Preferred solution) public void run() { super(); YourEnumControl.delete(enum2str(ABC::C)); } Override … Continue reading AX / D365FO – How to Hide Enum values on a Form Lookup x++

SQL SERVER – Find Index Fragmentation status using the T-SQL statement

Use this SQL statement to fnd fragmented indexes SELECT S.name as 'Schema', T.name as 'Table', I.name as 'Index', DDIPS.avg_fragmentation_in_percent, DDIPS.page_count FROM sys.dm_db_index_physical_stats (DB_ID(), NULL, NULL, NULL, NULL) AS DDIPS INNER JOIN sys.tables T on T.object_id = DDIPS.object_id INNER JOIN sys.schemas S on T.schema_id = S.schema_id INNER JOIN sys.indexes I ON I.object_id = DDIPS.object_id AND DDIPS.index_id … Continue reading SQL SERVER – Find Index Fragmentation status using the T-SQL statement

AX / D365FO – HOW TO SET QUICK FILTER IN D365 F&O

Here we will see couple of important property which needs to be filled for Filter to work. In Quick Filter control property 1.Target Control Property – Where we need to choose the Grid Control. 2.Default Column Property – Choose your desired column in Grid Without these set Filter wont work or list any columns. The … Continue reading AX / D365FO – HOW TO SET QUICK FILTER IN D365 F&O

AX / D365FO – SQL queries to get customers and vendor addresses and contact details

Below are the sample queries to get the vendors and customers addresses and contact details. Change the code according to your requirement. All VendorsSELECT * FROM VENDTABLE WHERE VENDTABLE.DATAAREAID='CEU' All Addresses - Vendor SELECT * FROM  DirPartyPostalAddressView  JOIN VENDTABLE ON  DirPartyPostalAddressView.PARTY =VENDTABLE.PARTYWHERE VENDTABLE.DATAAREAID='XXX' All Addresses with PurposeSELECT LOGISTICSLOCATIONROLE.*,DirPartyPostalAddressView.*,VENDTABLE.* FROM  DirPartyPostalAddressView  JOIN VENDTABLE ON  DirPartyPostalAddressView.PARTY =VENDTABLE.PARTYJOIN DIRPARTYLOCATIONROLE … Continue reading AX / D365FO – SQL queries to get customers and vendor addresses and contact details