Posts

Showing posts from 2017

Printing date in DDMMYYYY

date2str(DateTimeUtil::Date(resultSet.getDateTime(26)),123, DateDay::Digits2, DateSeparator::Slash, DateMonth::Digits2, DateSeparator::Slash, DateYear::Digits4, DateFlags::None),

Country Region ID Vendor or Customer

static void FindPrimaryAddress(Args _args) {     ProjInvoiceItem             projInvoiceItem;     VendInvoiceTrans            vendInvoiceTrans;     ProjTable                   projTable;     LogisticsPostalAddressView  logisticsPostalAddressView;     DirPartyLocation            dirPartyLocation;     RefRecId                    party,location;     VendTrans                   vendTrans;     VendTable                   vendTable;     //select ProjId from projInvoiceItem         //where projInvoiceItem.RecId == 5637145326;     select Name,CustAccount from projTa...

How to remove the \n from the string through X++ code

Image
How to remove the \n from the string through X++ code

Reading data from Common buffer

trvExpDataAreaId = CompanyInfo::findRecId(buffer.(fieldnum(TrvExpTable, LegalEntity))).DataArea;

How to find file type either .XLSX or .CSV AX 2012

static void fileType(Args _args) {     Filename filepath;     Filename filename;     Filename fileType;     str fileNameString,fileNamePath;       fileNamePath=@"D:\Sreekanth\3729\Hour rate2.csv";     [filepath, filename, fileType] = fileNameSplit(fileNamePath);     fileNameString= filename + fileType;     info(strFmt("filename=%1 \nfileType=%2",filename,fileType)); }

Global cache

Form Init method after super /// <summary> /// When form opens it will set the container value /// </summary> /// <param name="_handle"> /// habdle buffer will come from TrvExpTable init method /// </param> /// <remarks> /// When form opens it will set the container value /// </remarks> public static client void addHandleToCache(int _handle) {     #define.CACHE_OWNER('TrvExpTable')     container   con;     int         hWnd,i;     if (infolog.globalCache().isSet(#CACHE_OWNER, curUserId()))     {         con = infolog.globalCache().get(#CACHE_OWNER, curUserId());     }     for (i = conLen(con); i >= 1; i--)     {         hWnd = conPeek(con, i);         if (!WinApi::isWindow(hWnd))         {             conDel(...

Event click on ESC

When we click ESC button, task() method will call. 

Expense Journal Posting Debugger

EXPENSE JOURNAL [s]    \Classes\LedgerPostingGeneralJournalController\new            37 [s]    \Classes\LedgerPostingGeneralJournalController\add              37 [s]    \Classes\LedgerPostingGeneralJournalController\addLine           45

Writing Data to Excel for Date fileds

static void exportExcelFile(Args _args) {     SysExcelApplication     xlsApplication;     SysExcelWorkBooks       xlsWorkBookCollection;     SysExcelWorkBook        xlsWorkBook;     SysExcelWorkSheets      xlsWorkSheetCollection;     SysExcelWorkSheet       xlsWorkSheet;     SysExcelWorksheetHelper worksheetHelper;     SysExcelHelper          sysExcelHelper;     VendRFQJour             vendRFQJour;     VendTrans               vendTrans;     int                     row = 1;     str                     fileName;     str                     workshee...

While posting PO

Data will insert in the GeneralJournalAccountEntry table in the following class \Classes\SubledgerJournalTransferCommand\insertGeneralJournalAccountEntryRelated In the following method data first will insert in the temporary table and then it will start inserting into the all the subledger , general journal and posting tables \Classes\SubledgerJournalizer\loadaccountingDistributionTmp

Multiple Enum values as ranges X++ Query

qb.value(strfmt("%1,%2",enum2str(InventTransType::TransferOrderReceive),enum2str( InventTransType::purch) )));