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

AX / D365FO – Check if a FormControl is of type “String”, “Date” or “numeric”

I often work with FormControls and need to understand the type of control in order to use the right properties and methods. The code below shows how to intercept the control type and cast it with the matching type public void getFormControlType(FormControl _myFormControl) { FormRealControl callingRealControl; FormStringControl callingStringControl; FormIntControl callingIntControl; FormInt64Control callingInt64Control; FormDateControl callingDateControl; switch … Continue reading AX / D365FO – Check if a FormControl is of type “String”, “Date” or “numeric”

AX / D365FO – Show “NoYes” Enum field as Combobox instead of Checkbox

I'm building a form from a table. One of its fields is a enum YesNo. I can't figure out why every time I add it to the form it appears as a checkbox instead of a combobox. I want a combobox with a lookup and inside display the values "Yes" and "No". After several attempts … Continue reading AX / D365FO – Show “NoYes” Enum field as Combobox instead of Checkbox