Posts

Exporting AX Data to .csv File Through Class (Dialog)

Image
CLASS DECLARATION: class CustomerDataExtension_RunBase extends RunBaseBatch {     CustTable   custTable;     FilePath    TempPath;     Dialog      dialog;     DialogField dialogFieldFileSave;     FilenameOpen filename;     CommaTextIo file;     container line;       #File     #DEFINE.CurrentVersion(1)     #LOCALMACRO.CurrentList         TempPath     #ENDMACRO } DIALOG: protected Object Dialog() {     dialog = super();     dialogFieldFileSave     = dialog.addField(extendedTypeStr(FilenameSave),"File path","Help text goes here");     dialog.caption("Customer Data Extension");     dialog.filenameLookupFilter(['csv','*.csv']);     retu...

Export Model Store (AXUtil) - ax 2012

How To Export Model Store in ax 2012 (I Export the model store while Upgrading Clients Data Upgrade from R2 to R3) - First Open the CMD. - Go to the Path :  C:\Program Files\Microsoft Dynamics AX\60\Server\AX_Peregrine_IA\bin - Use Command :  Axutil set /installmode - Wait for a while. - Then use the second command after completing the first command :  Axutil exportstore  /file:c:\axr3modelstore\axr3modelstore

Find() Method in X++

How to write Find() Method : static AX_Student find(AX_StudentID   _studentId,                                        boolean       _forUpdate = false) {     AX_Student  newStudent;     if (_studentId)     {         if (_forUpdate)         {             newStudent.selectForUpdate(_forUpdate);         }         select firstonly newStudent             index hint StudentId             where newStudent.AX_StudentID == _studentId;     }     return newStudent; } you can also add more parameters in Find Method. static AX_StudentCourse find(AX_StudentID   _studentId, AX_CourseId _courseId,       ...

How to add select button for query form on a class

Image
public class CreateDialog extends RunBaseBatch {     DialogField dialoginventTablet;     InventTable inventTable;      QueryRun queryRun;     #define.CurrentVersion(1)     #define.version(1)     #localmacro.CurrentList     inventTable      #endmacro } To initilaize the queryRun object, override the initParmDefault method. public void initParmDefault() {     Query query;     QueryBuildDataSource    qbd;     QueryBuildRange     qbr;     super();     query = new Query();     qbd = query.addDataSource(tableNum(InventTable));     qbr = qbd.addRange(fieldNum(InventTable, ItemId));     queryRun = new QueryRun(query); } Pack and unpack method is must to save the state of queryRun. PACK :  public container pack() {   return ...

Purchase Requisition Error ( “The total, internal size of the records in your joined SELECT statement is 51314 bytes, but…” [AX 2012 R3])

Image
Purchase Requisition Error : “The total, internal size of the records in your joined SELECT statement is 51314 bytes, but…” [AX 2012 R3] - In Ax 2012 R2/R3 you might get this Error sometime (I get this error when I upgraded my machine    from R2 to R3), it came because of unnecessary del_ tables and fields are not deleted but remains in    the AOS which exceed the default (limit) size of select statement which is 49152 bytes. - Go to system information -> licensing -> license information.   Uncheck 6.0,6.2 and 6.3, then Apply it - In the tables bar, you will see the del_tables and del_fields, delete all of them.