AX / D365FO – Change the text colour of a Form field using X++

This example shows how to change the text colour of a Form control through X++ code. The color will be changed in RED TextControl.colorScheme(FormColorScheme::RGB); TextControl.foregroundColor(WinAPI::RGB2int(255,0,0)); And this will be the result If you want to convert to GREEN just modify like shown below TextControl.colorScheme(FormColorScheme::RGB); TextControl.foregroundColor(WinAPI::RGB2int(0,128,0));

AX / D365FO – How to change font size of control labels in D365 forms

Actually, the only way I found to increase Font Size of a Form Static text is to change the Style Property value of the control By default the property is set to Auto and the text appears in a normal size (like shown below) But I wanto to increase the size so I changed the … Continue reading AX / D365FO – How to change font size of control labels in D365 forms

AX / D365FO – Adding ConfigId in SALESLINE using X++

Code below shows the proper way of adding SalesLine with ConfigId SalesLine salesLine; InventDim inventDim; SalesId salesId = '100001' ItemId itemId = 'ITM1001'; ConfigId configId = 'CFG1001'; salesLine.initValue(); /* Init SalesLine from SalesTable*/ salesLine.SalesId = salesId; salesLine.initFromSalesTable(salesTable); /* End*/ /* Set SalesLine Item*/ salesLine.ItemId = itemId; /* End*/ /* Set Retail Variant Id*/ inventDim.configId = … Continue reading AX / D365FO – Adding ConfigId in SALESLINE using X++

AX / D365FO – Insert a Yes/No Message box on a Form Click Button event

While any operation is performed by the user, there are cases such as need to receive confirmation from the user to perform the operation. In these cases we can use “DialogButton” for user interaction not say “Yes/No” to perform the operation. Below is an example code public void clicked() { DialogButton diagBut; str strMessage = … Continue reading AX / D365FO – Insert a Yes/No Message box on a Form Click Button event

AX / D365FO – Using “Not Like” in X++ select statements

If you want to use wild-cards in Ax, you can write a SQL statement with a LIKE keyword SalesTable salestable; select firstonly salestable where salestable.salesId like '123*'; But if you want to use NOT LIKE you can do in 3 different ways : SalesTable salestable; select firstonly salestable where !(salestable.salesId like '123*'); SalesTable salestable, salestableExists; … Continue reading AX / D365FO – Using “Not Like” in X++ select statements