Skip to main content

Posts

Showing posts from June, 2012

How to export data from table to word file in MSD Axapta

CommaIo urfile; LedgerTrans LedgerTrans1; Container container1; sqlDictionary sqlDictionary; TableName tablenm; ; tablenm = "LedgerTrans1"; select * from sqlDictionary where Tablename2id(tablenm) == sqlDictionary.tabId; if(sqlDictionary.RecId > 0) { urfile= new CommaIo("c:\\test.doc","w"); urfile.outFieldDelimiter("\t");/ while select LedgerTrans1 { container1= [LedgerTrans1.AccountNum,LedgerTrans1.Txt]; urfile.writeExp(container1); } }

how to use datetime utility method in MSD axapta

info(strfmt("%1 - %2", DateTimeUtil::getUserPreferredTimeZone(), enum2str(DateTimeUtil::getUserPreferredTimeZone()))); //DateTimeUtil::applyTimeZoneOffsetcusttable.createdDateTime,DateTimeUtil::getUserPreferredTimeZon()); info(strfmt("%1 - %2",DateTimeUtil::applyTimeZoneOffset(CustInvoiceJour.createdDateTime, DateTimeUtil::getUserPreferredTimeZone()), custtable.modifiedDateTime));

error on Event log at the time of EP Site creation in MSDAX

Following error on Event log at the time of EP Site creation. How could we resolve this error. If I will resolve then will post answer soon. SQL Database 'SharePoint_Config_26c83dac-e459-49a3-80f5-10c1b1dee635' on SQL Server instance 'np:\\.\pipe\MSSQL$Microsoft##SSEE\sql\query' not found. Additional error information from SQL Server is included below. Cannot open database "SharePoint_Config_26c83dac-e459-49a3-80f5-10c1b1dee635" requested by the login. The login failed. Login failed for user 'test\bcproxy'. Could you put your comment for this error

Read data from text file using Aciilo in MSD axapta x++

Read data from text file using Aciilo in axapta x++ AsciiIo filetoread; str ln; container filecontents; ; filetoread = new AsciiIo("C:\\test.txt" , 'R'); filetoread.inFieldDelimiter("1234567890abcdefghijklmnop"); filecontents = filetoread.read(); while (filecontents) { ln = con2str(filecontents); info(ln); filecontents = filetoread.read(); }

Prompt dialog or modal window type in MSD axapta

Prompt dialog or modal window type in axapta Box::info(str _msg,str _title); Box::warning(str _msg,str _title Box::stop(str _msg,str _title); Box::infoOnce(str _heading,str _information,str owner); DialogButton _DialogButton ; _DialogButton = Box::yesNo(str _msg,DialogButton _defaultButton,str _title); _DialogButton = Box::yesAllNoAllCancel(str _msg,DialogButton _defaultButton,str _title);

Code to call Excel Macro using MSD X++ language or axapta

Code to call Excel Macro using X++ language or axapta SysExcelApplication ExcelApplication1; SysExcelWorkbooks WorkBooks; SysExcelWorkbook WorkBook; SysExcelWorksheet Worksheet; ; ExcelApplication1= SysExcelApplication::construct(); ExcelApplication1.displayAlerts(true); ExcelApplication1.visible(true); ExcelApplication1.workbooks().open("SomeExcelFile.xls"); Workbook = ExcelApplication1.workbooks().item(1); Worksheet = Workbook.worksheets().itemFromName("Name of worksheet"); ExcelApp.comObject().Run("Macro1");

How to add the form node to project in MSD Axapta

How to add the form node to project ,You can write following code in job to test adding node code. void AddnodeToProject(HWND AxChild) { ProjectNode ChildMenuItemNode; ; ChildMenuItemNode = CDT_Global::extractProjNode(AxChild); if (ChildMenuItemNode) { ChildMenuItemNode = ChildMenuItemNode.getRunNode(); ChildMenuItemNode.lockUpdate(); ChildMenuItemNode.addUtilNode(UtilElementType::Form, formName); ChildMenuItemNode.unlockUpdate(); ChildMenuItemNode.AOTcompile(1); ChildMenuItemNode.AOTcompile(1); ChildMenuItemNode.AOTSave(); } }

strScan and Find a first occurrence of a string in a string using x++

strScan (Find a first occurrence of a string in a string) info("int strScan(str _text1,str _text2,int _position,int _number)"); info("Searches a text string for the occurrence of another string."); info("_text1 - The text string to search."); info("_text2 - The string to find."); info("_position - The position at which the search should start."); info("_number - The number of characters that should be searched."); info(int2str(strScan("ABCDEFGHIJ","DE",1,10)));

Infolog in MSD axapta

Infolog The Infolog is used to communicate with the application users. You use the Infolog to inform the user of validations, if an error occurs, or to display information to the user while processing a job. The Infolog is opened in a separate window, and opens automatically when called by a program. Information in the Infolog is removed when the Infolog window is closed, so if you need the information for later use, you can print the contents of the Infolog window by using the print menu item in the top menu. Information in the Infolog can be triggered both from code and by the kernel. Kernel information typically involves system integrity issues, such as information about mandatory database fields. From X++ you can control the information in the Infolog. There are three types of information in the Infolog. The types, which may be identified by the associated icon include: info , warning and error . Info text is generally displayed to inform the user about actions being perfor

Stop or Close a Period in MSD axapta

Stop or Close a Period in axapta Follow these steps to stop or close a period. 1. Click General ledger, click Setup, click Periods, and then click Periods. 2. Click the period to edit, and then click the Status arrow. 3. Select either Stopped or Closed in the Status field. By setting a prior period to stopped, no additional postings can occur in that period. Because you cannot reopen a closed period, set periods to stopped instead of closed.