Skip to main content

Posts

Showing posts from June, 2012

FTP from Axapta

FTP from Axapta From Axaptapedia from Development Axapta by (Dahlsgaard Jan) add at the class declaration of the WinInet class the following: DLLFunction _internetConnect; DLLFunction _ftpGetFile; DLLFunction _ftpPutFile; and this in the 'new': _internetConnect = new DLLFunction ( _winInet, "InternetConnectA" ) ; _internetConnect. returns ( ExtTypes:: DWORD ) ; _internetConnect. arg ( ExtTypes:: DWORD ) ; _internetConnect. arg ( ExtTypes:: STRING ) ; _internetConnect. arg ( ExtTypes:: DWORD ) ; _internetConnect. arg ( ExtTypes:: STRING ) ; _internetConnect. arg ( ExtTypes:: STRING ) ; _internetConnect. arg ( ExtTypes:: DWORD ) ; _internetConnect. arg ( ExtTypes:: DWORD ) ; _internetConnect. arg ( ExtTypes:: DWORD ) ; _ftpGetFile = new DLLFunction ( _winInet, "FtpGetFileA" ) ; _ftpGetFile. returns ( ExtTypes:: DWORD ) ; _ftpGetFile. arg ( ExtTypes:: DWORD ) ; _ftpGetFile. arg ( ExtTypes:: STRING ) ; _ftpGetFile. arg ( ExtTypes:

sales price and cost price

sales price B_RepairJournalOrderLines.ProjSalesPrice = InventTable::find(B_RepairJournalOrderLines.ItemId).LastUserPrice; cost price     B_RepairJournalOrderLines.ProjCostPrice = InventTableModule::find(B_RepairJournalOrderLines.ItemId,ModuleInventPurchSales::Sales).price() ;

export a document to MS Word from axapta using X++

COM wordApplication; COM wordDocuments; COM wordDocument; COM wordRange; ; wordApplication = new COM("word.application"); wordApplication.visible(TRUE); wordDocuments = wordApplication.Documents(); wordDocument = wordDocuments.add(); wordDocument.saveas("c:\\YourDocument.doc"); wordDocument.activate(); wordRange = wordDocument.range(0,0); wordRange.insertafter("mouli); wordRange = wordDocument.range(6,19); wordRange = wordDocument.range(11,26); wordRange.italic(true); wordDocument.save(); wordDocument.close(); wordApplication.quit();

X++ CODE TO READ MS OFFICE WORD DOCUMENT

Use the below job if you want to read text from MS Word document in Dynamics Ax 2009. static void FileIO_ReadFromWord(Args _args) { str document = "D:\\Demo Edition.doc"; COM wordApplication; COM wordDocuments; COM wordDoc; COM range; TextBuffer txt = new TextBuffer(); ; // Create instance of Word application wordApplication = new COM("Word.Application"); // Get documents property wordDocuments = wordApplication.Documents(); // Add document that you want to read wordDoc = wordDocuments.add(document); range = wordDoc.range(); txt.setText(range.text()); // to replace carriage return with newline char txt.replace('\r', '\n'); info(txt.getText()) ; }

How to export data from table to word file in 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); } } Posted by Santosh kumar Singh

Twenty must know tips before ERP Implementation

Microsoft Dynamics® AX 2009: How to Call AX 2009 from an External Application and Open a Specific Form/Record

(This post courtesy of Natalia Efimtseva) Recently I worked with my colleague, Max Belugin, who is an expert in Dynamics. We were solving one interesting question—how you can activate and open a specific AX 2009 form/record from an external application or code. You can use following approaches to open AX from an external environment: 1. COM API Unfortunately, at the current moment .NET Business Connector doesn’t implement UI function, and thus it is not possible to open a specific AX form. But we can register AX32.EXE as a COM Object. static void Connect( string [] args) { AxClientLib.DynamicsAxApplication dynamicsClient; try { //find running Ax32.exe dynamicsClient = (AxClientLib.DynamicsAxApplication)System.Runtime.InteropServices.Marshal.GetActiveObject( "Dynamics.Application" ); } catch { //Launch new Ax32.exe dynamicsClient = new AxClientLib.DynamicsAxApplicationClass(); } if (dynamicsClient != null ) { //Run form dynamicsClient.OpenMenuItem( "DMO"

a Job to update the SID after a Domain change

but you could also use it to Sync the active accounts between AD and AX static void ChangeDomain(Args _args) { UserInfo userInfo; xAxaptaUserManager axUsrMgr; xAxaptaUserDetails axUsrDet; Boolean doUpdate; Username user; SID oldSID; #define.NewDomain("New.DOMAIN.NET") ; doUpdate = Box::yesNo("User aktualisieren?", DialogButton::No) == DialogButton::Yes; axUsrMgr = new xAxaptaUserManager(); ttsbegin; setPrefix('SID-Aktualisierung'); while select forupdate userInfo { axUsrDet = axUsrMgr.getDomainUser(#NewDomain,userInfo.networkAlias); if(userInfo && axUsrDet) { oldSID = userInfo.sid; userInfo.networkDomain = #NewDomain; userInfo.sid = axUsrMgr.getUserSid(userInfo.networkAlias, #NewDomain); if(doUpdate) { info(strfmt("Aktualisiert", userInfo.networkAlias)); userInfo.update(); } } else { error(strfm

Financial Consolidations - Dynamics Ax 2009

Siva Jammalamadaka Siva Jammalamadaka Microsoft Services 588 Points 3 1 0 Recent Achievements New Blog Rater Blogger II New Blog Commentator View Profile 10 Jun 2011 Financial Consolidations process: 3 steps to perform consolidation in Microsoft Dynamics Ax 2009. I ) Consolidation company setup II) Subsidiary company setup III) Perform consolidation I) Consolidation company setup: Consolidation company creation: Consolidation designated company will not be available for any operational process except having consolidation entries posted in here. Path: Dynamics Ax > Administration > Common Forms > Company accounts GL Parameters setup: Path: Dynamics Ax > General Ledger > Setup > Parameters > Ledger tab Set value "Consolidated company accounts ' = True System account: Path: Dynamics Ax > General Ledger > Setup > Posting > System accounts Balance account for consolidation differences Profit & loss account for c

Let's compile the thing!

By Jakob Steen Hansen, Development Manager, Dynamics AX Developer Tools and Business Intelligence. One thing that can only be underestimated is the value of having a heartbeat for your product. The heartbeat provides a regular rhythm to your engineering process, ensuring that the state of the product is well-known on an ongoing basis. A heartbeat consists of many different parts, the build process being one of the most prominent ones. When working with AX, how are you going to get this heartbeat? It all depends on how advanced your engineering practices are. In this blog post and some to follow, I’ll talk about the purpose of a heartbeat and show how to establishing various levels of automation, including a nightly build and tools/techniques we can use to optimize the engineering system when we have a nightly build. My examples are going to be focused on AX 2012, but many of them apply to AX 2009 with little or no change. Let’s look into the specifics for the two extremes of engin

Release products to the legal entities using X++

static void releaseProducts_Job(Args _args) { EcoResProduct ecoResProduct; InventTable inventTable; InventTableModule inventTableModule; NumberSequenceTable numberSequenceTable; ItemId itemId; InventItemSetupSupplyType inventItemSetupSupplyType; EcoResStorageDimensionGroupProduct ecoResStorageDimensionGroupProduct; EcoResTrackingDimensionGroupProduct ecoResTrackingDimensionGroupProduct; EcoResStorageDimensionGroupItem ecoResStorageDimensionGroupItem; EcoResTrackingDimensionGroupItem ecoResTrackingDimensionGroupItem; ; select firstOnly ecoResProduct where EcoResProduct.DisplayProductNumber == "test"; //Audio system changecompany ('CEU') { ttsBegin; inventTable = null; inventTableModule = null; inventItemSetupSupplyType = null; ecoResStorageDimensionGroupProduct = null; ecoResTrackingDimensionGroupProduct = null; ecoResStorageDimensionGroupItem = null; ecoResTrackingDimensionGroupItem = null; numberSequenceTable = InventParameters::num

Batch Task Dependency in Dynamics AX 2009

Scenario : You want to schedule 2-3 tasks, but you would like to define dependency among tasks. Means Task1 should be executed only after completion of Task 3 and Task 2. Advantage : You all might have heard of "Divide and Conquer Rule", So this also implements the same. Generally if you create batch to process 1000 Purchase orders then it might slow down the AOS performance and delay the overall batch performance. But if you create batch and create 10 tasks, each process 100 Purchase orders then will be fast compared to above procedure and will improve overall batch performance. How to : In Dynamics AX 2009, Batch process will make use of below tables BatchJob : Main Job scheduler, consists of task BatchTask : Task in batch which specifies what class to execute in order to achieve certain functionality. BatchConstraint : Used to build dependencies among the tasks. Create a Job, by using below code static void Batch_Creat

Announcing Rollup 8 for Microsoft Dynamics AX 2009 SP1

http://community.dynamics.com/product/ax/axtechnical/b/axsupport/archive/2012/03/29/overview-of-ax-build-numbers.aspx The Dynamics AX Sustained Engineering team released Rollup 8 for Microsoft Dynamics AX 2009 SP1 on March 21, 2012. This release includes all previously released rollups for Dynamics AX 2009 SP1 plus additional hotfixes and improvements based on feedback from our customers and partners. In addition, we would also like to announce the availability of Rollup 8 release for Professional Services Automation for Microsoft Dynamics AX 2009 SP1 as well as Rollup 8 for Project Time Management for Microsoft Dynamics AX 2009 SP1. All three of these release are available for immediate download on Partner Source and Customer Source. For more information on Rollup 8 and to download, please refer to the following knowledge base articles. KB2677618 : Rollup 8 for Microsoft Dynamics AX 2009 SP1 KB2678991 : Rollup 8 for Project Time Management for Microsoft Dynamics AX 2009 SP1 KB26