Skip to main content

Posts

Showing posts from 2017

Newly created data entity is not visible in data management entity list?

If you created a new data entity and it's not visible in your data management entity list.  Open Data Management workspace -> Framework parameters -> Entity Settings and hit the "Refresh Entity List" button

D365FO: How to debug a non-development and a non-production environment

This post outlines the steps how to debug an issue which is happening in non-development or non-production environments e.g. UAT environment. 1.     RDP to your environment where you want to debug the issue, with this example I am connecting to UAT (Sandbox).  2.     Connect to SQL server a.      Get the server name from LCS database accounts b.     Use .database.windows.net to connect to database 3.     Create a new SQL sign-in that the developer can use. This step lets the system administrator maintain the security of the sandbox environment. The developer will have access to one database for only a limited time. Use the following code to create the new SQL sign-in. CREATE USER devtempuser WITH PASSWORD = 'pass@word1' EXEC sp_addrolemember 'db_owner' , 'devtempuser' 4.     Stop following services in development box a.      ...

Read excel through X++ in D365FO

Sample code to read an excel file, all it need file stream as a parameter. public boolean importFromExcelfiles(System.IO. Stream _stream) {    OfficeOpenXml. ExcelWorksheet         worksheet;    OfficeOpenXml. ExcelRange             cells;    OfficeOpenXml. ExcelPackage           package = new OfficeOpenXml. ExcelPackage (_stream);             int totalRows,totalCells,rowCounter,cellCounter;     if (package)    {       worksheet       = package.get_Workbook().get_Worksheets().get_Item( 1 );       cells           = worksheet.Cells;       totalRows       = worksheet....

D365FO - Method wrapping and chain of command

Another most awaiting Extensibility feature (Chain of Command) is going to come with one of the next platform updates.  This enables you to call/use protected members and methods without making them hookable and using pre/post event handlers.  More details are here  https://blogs.msdn.microsoft.com/mfp/2017/07/04/extensible-x-chain-of-command/  and also here  https://roadmap.dynamics.com/?i=296a1c89-ce4e-e711-80c0-00155d2433a1#.WVw1llbSw-M.linkedin Stay tuned on above road map site to find more on this feature.

AX 2012 : Remove an XML node through X++

Following code snippet may help you to remove an XML node from an XML message string. private str removeXMLTag( str xml) {     XmlDocument         doc = new XmlDocument();     XmlElement          nodeScript;     XmlNode             parentNode, childNode;     XmlNodeList         xmlScriptList,                         parentNodeList,                         childNodeList;     int                  i...

AX 2012: Reading files from directory through X++

Following code can be used to read files from the specified path. With this example, I am reading a CSV files from a directory. Class declaration class readFilesFromDirectory extends RunBase {     FilePath            filePath;     Filename            filename;     CommaTextIo         fileIO;     Set                 fileSet;     CommaIo             commaIo;     str                  currentFile;     container            lineCon; ...