Microsoft Dynamics AX - 3. Operations Development Knowledge Center: AX 2. AX 2. 00. 9 and Secure FTP / SFTP Integration AX2. AX2. 00. 9. This post demonstrates how to integrate AX 2. Secure FTP. I have used the WINSCP tool to achieve the SFTP file read and write. Steps overview: -1. Download WINSCP and Place it in proper folder (For instance folder name is WINSCP)2.
- Microsoft - 207 Microsoft interview questions and 248 answers by expert members with experience in Microsoft subject. Discuss each question in detail for better.
- The Partner Channel provides sales, marketing, and leadership-focused publications and events for Microsoft Dynamics Partners, connecting the Partner community in.
Give AOS credetial access to the WINSCP folder (this is required when you run it in Batch)3. Run/Configure WINSCP. This is mandatory setup. Copy the host key - this key is used in X++ to call the SFTP5. Create bat and script file for execution inside WINSCP folder - You can handle this in X++ code. You can use the same folder to download/upload the file. Below code used to get the file from SFTPstatic void SFTP_GETFILES(Args _args){Text.
Io text. Io. File; Set permission. Set; File. Name file. Path, batch. File. Name, script. File.
Warehouse management and transportation management add on modules for Microsoft Dynamics AX ERP system. Blue Horseshoe's advanced supply chain solutions extend base. KBS Training provides Microsoft Dynamics CRM Training online with live projects. Enroll CRM Course today become expert across the global Bangalore, Hyderabad, USA, UK.
![Microsoft Dynamics Ax Technical Interview Questions Microsoft Dynamics Ax Technical Interview Questions](http://synermatrix.com/images/innerbanner4.jpg)
Name; Interop. Permission interop. Perm; System. Diagnostics. Process process; System. Diagnostics. Process. Start. Info process. Start. Info; System.
Exception ex; ;file. Path = 'C: \\WINSCP\\'; //WINSCP folder batch. File. Name = file. Path + 'readfile.
File. Name = file. Path + 'readfile. Script. txt'; try{//Creating BAT Filepermission. Set = new Set(Types: :Class); permission.
Set. add(new File. Io. Permission(batch.
File. Name, "W")); Code. Access. Permission: :assert. Multiple(permission. Set); text. Io. File = new Text. Io(batch. File. Name , "W", 0); Code. Access. Permission: :revert. Assert(); text. Io.
File. write(str. Fmt('winscp. File. Name)); text. Io. File = null; //Creating SCRIPT Filepermission. Set = new Set(Types: :Class); permission. Set. add(new File. Io. Permission(script. File. Name, "W")); Code.
Access. Permission: :assert. Multiple(permission. Set); text. Io. File = new Text. Io(script. File. Name , "W", 0); Code. Access. Permission: :revert.
Assert(); text. Iofile. Host key"'); text. Io. File. write(str. Fmt('get /SFTP_FOLDERNAME/* %1', file.
Path)); //get the file from SFTP//text. Io. File. write(str. Fmt('mv /SFTP_FOLDERNAME/*. SFTP_FOLDERNAME/Archive/')); //Use this code to move the file inside SFTP//text.
Io. File. write(str. Fmt('put %1 /SFTP_FOLDERNAME/', file. Path + "\\" + "Uploadfile. Use this code to upload the file to SFTPtext. Io. File. write('exit'); text. Io. File = null; //EXECUTE SFTPnew Interop. Permission(Interop.
Kind: :Clr. Interop). System. Diagnostics. Process(); process. Start. Info = new System. Diagnostics. Process. Start. Info(); process. Start. Info. set_File.
Name(batch. File. Name); process. Start.
Info. set_Working. Directory(file. Path); process.
Start. Info(process. Start. Info); process. Start(); //this method call the SFTPprocess. Wait. For. Exit(); Code. Access. Permission: :revert. Assert(); interop.
Perm = new Interop. Permission(Interop. Kind: :Clr. Interop); interop. Perm. assert(); System. IO. File: :Delete(batch.
File. Name); System. IO. File: :Delete(script. File. Name); Code.
Access. Permission: :revert. Assert(); }catch (Exception: :CLRError){ex = Clr. Interop: :get. Last. Exception(); if (ex != null){ex = ex. Inner. Exception(); if (ex != null){error(ex.
To. String()); }}}}You can refer WINSCP portal for more details and commands. Hope this helped you to understand the AX and SFTP integration. Happy DAXing,Cheers,Arun.