Labels

Friday, September 28, 2012

Simple notification service

In Microsoft Dynamics NAV 2009 platform new triggers OnDatabaseInsert, OnDatabaseModify, OnDatabaseDelete, OnDatabaseRename were added. They are fired even in code you don't call triggers  INSERT, MODIFY, DELETE with TRUE arguement. In standard functionality these triggers are used for integration with Microsoft Dynamics CRM product.
The Business Notification Server functionality is too complex and requires some additional granules, that costs some money. So, I 've created the alternative lightweight universal solution for notification. IT manager has the possibility to subscribe user for special events on any table. And user will get notification in his mailbox.

Thursday, March 29, 2012

Converting docx file to stylesheet


From NAV version 5.0 here's the possibility to send forms to Word/Excel. This functionality uses progressive XSLT technology, which uses source XML file with data + XSLT file with view template.
There is special tool to make the process of using templates much easier. See http://www.mibuso.com/dlinfo.asp?FileID=869 for additional info. But unfortunately this don't works for me. 
I prefer to investigate the manual creation of XSLT from source DOCX file. It's very important to use Word 2007 - 2010 and DOCX extension, because it's represents by XML file.
1. Firstly we should do the "bookmarks" in source text, where we want to export some values, e.g. fldVIN in the location, where's VIN should be.
2. Save DOCX file. Change the extension to ZIP. Inside archive find the file document.xml and copy it to initial folder.
3. Open the document.xml in notepad editor and replace text at the start of file (from the beggining to the tag <w:body>):