Pass Args with Menu Item and open form with passes parameter x++
args.parm(parameter value); // calling menu item new MenuFunction(identifierstr(SampleTest), MenuItemType::Action).run(args);
How to convert from date to string using x++ in X++
void DateTStringConvert() { date today=today(); str TodayDate; ; TodayDate = date2str( today,321,DateDay::Digits2,DateSeparator::Slash,DateMonth::Digits2,DateSeparator::Slash,DateYear::Digits4); info(TodayDate ); }
Write Data from Ax table to Excel Sheet x++
Static server void Salah_WriteFile(Args _args) { TextIo file; Filename filenmae= @”C:/Temp”; Salah_CarTable carTable; container con; FileIOPermission permission; #File try { // Create the permission class permission = new FileIoPermission(filename, #io_write); // Add a request for permission before new TextIo() permission.assert(); // Create the TextIo object file = new TextIo(filename, #io_write); if (!file)…
Prompt to import excel
Dialog _dialog; DialogField _file; ; Dialog _dialog; DialogField _file; _dialog = new Dialog(“Please select the file to load”); _dialog.addText(“Select file:”); _file = _dialog.addField(ExtendedTypeStr(“FilenameOpen”)); _dialog.run(); if (_dialog.closedOK()) { info(_file.value() ); }
How to convert numbers into Arabic numeric in X++?
http://dynamics365ax2012.blogspot.com/2017/12/how-to-convert-numbers-into-arabic.html
Filter datasource with 2 values x++
form_ds.query().dataSourceTable(tableNum(your_table)).addRange(fieldNum(your_table, AccountNum)).value(“!value1, !value2”);
How do I check if a string contains another string
if(strScan(Y,X,1,strLen(Y)))