How to test if Amyuni PDF Converter is working (outside of Dynamics NAV)

Ok, so you have installed Amyuni PDF Converter. You even tried modifying install.ini file for faster installation. Well done!

Now, shall we test whether your Amyuni PDF Converter is working correctly?

Go to C:\PDF Converter and created new folder Test:

Test - Create Folder

Create a new text file and name it Test Amyuni.VBS:

Test - Create VBS

Right-click > Edit:

Test - Edit VBS

Copy and paste this to the file and save the file (please note: this works with testing version 5):

Dim PDF 
Set PDF = CreateObject ("CDintfex.Cdintfex.5.0")
with PDF
'Change to the printer name you normally install
.DriverInit "Amyuni PDF Converter"
.SetDefaultPrinter
.DefaultDirectory = "C:\PDF Converter\Test\"
.DefaultFileName = "C:\PDF Converter\Test\TestResult.pdf"
.FileNameOptions = 3
.EnablePrinter "YOUR COMPANY NAME","YOUR LICENSE ACTIVATION CODE"
.BatchConvert "C:\PDF Converter\Test\TestFile.txt"
.RestoreDefaultPrinter
.FileNameOptions = 0
end with
Set PDF = Nothing

Create a new TestFile.txt:

Test - Create Text File

Double-click on Test Amynui.VBS.

If this generated TestResult.PDF file, your printer has been installed (and license activated) correctly.

Test - Print to PDF

That was easy!? ūüôā

Next, we will have a look at how to develop for Amyuni PDF Converter in Dynamics NAV and how to test whether it works with Dynamics NAV.

Technorati Tags: , ,

Posted in Dynamics NAV / Navision | Tagged , , | Leave a comment

How to install Amyuni PDF Converter for Dynamics NAV

When you buy AmyUni PDF, you will get an email with a link https://www.amyuni.com/shoppingcart/updates.php and your username/password. Once logged in, you will be able to retrieve any versions that you have previously bought by clicking “Version X.X – Download”.

PDF Converter PRO Developer

This will download an archive file. Extract it on your C:\ drive as:

PDF Converter

For printing from Dynamics NAV, we are interested only in PDF Converter Printer Driver folder:

PDF Converter Printer Driver

Click Start > All Programs > Accessories.
Right click on Command Prompt and select “Run as administrator”:

Command Promt - Run as Administrator

Go to the folder C:\PDF Converter\PDF Converter Printer Driver by typing command:
cd C:\PDF Converter\PDF Converter Printer Driver

Command Prompt - CD

Type in the command “install -u” (this will make sure that, if there were any previous versions of Amyuni PDF printer installed, they will get uninstalled)

Command Prompt - uninstall

To install new version, type the command “install”. This may take a few minutes. When install is finished, system will display a message saying “Printer setup succeeded”.

Command Prompt - install

To check this, we can go to “Start > Devices and Printers” and we will see printer “Amyuni DF Converter”.

Installed Amyuni PDF Converter

Right-click on the “Amyuni PDF Converter” and select “Printer Properties“:

Printer Properties

Go to “About” tab and click on “‚Ķ” button and enter your company name and your license activation code.

Licensed To

That’s it – Amyuni PDF Printer has been installed!

Tip: Let’s say you want to install Amyuni PDF Printer on several computers (you will need it installed on every computer from which you will be printing reports to PDF in Dynamics NAV). Is there a way of skipping the setup part? Of course, there is!

PDF Converter install ini

If you would go to C:\PDF Converter\PDF Converter Printer Driver and open “install.ini” file, you can define “YOUR COMPANY NAME” and “YOUR ACTIVATION CODE”. You can also change the printer name – instead of “Amyuni PDF Converter” you could call printer “Dynamics NAV PDF Converter”. Once the install.ini file is updated, when you run “install” command in command line, printer will be installed and setup automatically.

Next, we will have a look at how to test if Amyuni PDF Converter has been installed correctly.

Technorati Tags: , ,

Posted in Dynamics NAV / Navision | Tagged , , | Leave a comment

Amyuni PDF Converter for Dynamics NAV

“I want to send out my reports from NAV as PDF files”.

This is quite a common request and there are many ways of achieving this. In newer Dynamics NAV versions you can use SAVEASPDF function, but in older Dynamics NAV versions, you would need a PDF printer. In this series I will have a look on how we can use Amyuni PDF Converter for Dynamics NAV.

If you are a developer and you have been given a task of creating modification for sending out reports as emails with PDF attachments (and one of the requirements is to use Amyuni PDF Converter), I know you will find this information useful.

If you are using some other PDF Printer, you can skip¬†these upcoming series of posts. I will not be mad ūüôā

We will cover these topics:

  • How to install Amyuni PDF Converter for Dynamics NAV
  • How to test if Amyuni PDF Converter is working (outside of Dynamics NAV)
  • How to use Amyuni PDF in C/AL
  • How to test if AmyUni PDF is working (within Dynamics NAV)
  • How to send printed PDF file by email
  • Most common problems for Amyuni PDF
  • Alternatives for Amyuni PDF

If you have any questions/suggestions, don’t hesitate to leave a comment.

Technorati Tags: , ,

Posted in Dynamics NAV / Navision | Tagged , , | 1 Comment

When does Dynamics NAV 2009 R2 support end?

goodbye

When does Dynamics NAV 2009 R2 support end? Well…

I’ve written back in 2011 saying “how often do you get a question – is Dynamics NAV 4.3 still supported?” and I am feeling a little bit of¬†D√©j√† vu now, when we¬†talk about Dynamics NAV 2009 R2.

Mainstream Support for Microsoft Dynamics NAV 2009 R2 has ended on 13/01/2015. Done. Gone. No longer here.

Mainstream Support for Microsoft Dynamics NAV 2013 and NAV 2013 R2 will end on 09/01/2018.

Mainstream Support for Microsoft Dynamics NAV 2015 will end on 20/01/2020.

Is it time to think about upgrade?

Links:

Technorati Tags: , ,

Posted in Dynamics NAV / Navision | Tagged , , | Leave a comment

How to connect to Dynamics NAV 2015 with one click?

How can you connect to Dynamics NAV with one click? Ok, ok‚Ķ I may have oversold you on the idea of “one click”. In fact, it is one double-click. You could do it so easily with Dynamics NAV Classic client – create a shortcut and define connection string (using properties SERVERNAME, DATABASE, COMPANY). Easy!

But days of the Classic client are almost gone, and we are looking into the future. And the future is now! We have been working with RoleTailored client for a while now, and sometimes people ask me – how do I do the same in NAV 2013 and NAV 2015? How do I connect to Dynamics NAV 2015 with one click?

The approach is actually the same – create a shortcut and define connection string.

The only difference is in how we define a connection string. We don’t have same properties (SERVER, DATABASE, COMPANY) anymore, but we do have a possibility of composing Dynamics NAV URLs (and running them).

Let’s have a look (I have done this with NAV 2015)
1. Go to C:\Program Files (x86)\Microsoft Dynamics NAV\80\RoleTailored Client
2. Right-click on Microsoft.Dynamics.Nav.Client.exe > Send to > Desktop (create shortcut)

Create Shortcut
3. Right-click on the shortcut > Properties

Properties
4. In the “Shortcut tab”, in the “Target” field, after “C:\Program Files (x86)\Microsoft Dynamics NAV\80\RoleTailored Client\Microsoft.Dynamics.Nav.Client.exe” add the new connection string

Target

"DynamicsNAV://localhost:7046/DynamicsNAV80/CRONUS International Ltd./"

5. Click OK and double-click on the shortcut
6. Result!

So, what is the new connection string made of exactly? My URL above would translate to generic URL:

"dynamicsnav://myserver:7046/myInstance/myCompany/"

Further reading:

Technorati Tags: , , , , ,

Posted in Dynamics NAV / Navision | Tagged , , , , , | Leave a comment

How to use FINDSET function in Dynamics NAV?

FINDSET Function

So, do you know how to use FINDSET function? Of course you do… you always use it like IF FINDSET THEN REPEAT UNTIL… right? You have it in your blood. You have used it so many times… you can’t even remember when was the first time you have used FINDSET. This must be the easiest question, you can get on technical interview, right?

Well… let’s dig deeper. What parameters has function FINDSET? TRUE, FALSE? FALSE, FALSE? No… I meant, what parameters, as in what do they do?

… Western-movie-type¬†silence …

Obviously, I have helped you here with a screenshot above… but once, when I got this question, I was not able to answer it. And I think that is the main reason why now, I could remember this, even if you would wake me up in the middle of the night – FINDSET(ForUpdate, UpdateKey)

ForUpdateType: Boolean
Set this parameter to true if you want to modify any records in the set; otherwise, set the parameter to false.
If you set this parameter to true, then the LOCKTABLE Function (Record) is immediately run on the table before the records are read.

UpdateKeyType: Boolean
Set this parameter to true if you want to modify any field value within the current key.
This parameter only applies if the ForUpdate parameter is true.

So, as they say, now ¬†you know…

Next question: Why are you still not using parameters in this function?

Further reading:

Technorati Tags: , , ,

Posted in development, Dynamics NAV / Navision, Tips & Tricks | Tagged , , , | 7 Comments

What does the field Use Legacy G/L Entry Locking actually do in NAV 2013?

Do you or your customers have peak hours when all the sales orders and invoices need to be posted at the same time? Or do you have large numbers of postings that need to be run without blocking other users?” – I loved the way NAV Team introduced¬†new locking functionality of NAV 2013. But they also left a way of using old functionality – by enabling field “Use Legacy G/L Entry Locking” in General Ledger Setup.

The field “Use Legacy G/L Entry Locking” has been around for a long time (since NAV 2013), but it is something I haven’t paid special attention to. The field name sounds menacing, but what does it actually do?

According the documentation, field “Use Legacy G/L Entry Locking

Specifies when G/L Entry table should be locked during sales, purchase and service posting. By default, the check box is cleared to leave the G/L Entry table unlocked at the start of posting. The table remains unlocked until the lock is needed. This can improve performance in multiuser environments.

Sounds good. Now, what does it mean for a developer?

When I want to understand something in more detail, I start by asking – where is it used?

We can see that there is a field in General Ledger Setup, but let’s crawl through the code and learn more.

General Ledger Setup - Use Legacy GL Entry Locking

The field “Use Legacy G/L Entry Locking” is used only in a few places:

  1. OBJECT Table 98 General Ledger Setup, PROCEDURE OptimGLEntLockForMultiuserEnvUse Legacy GL Entry Locking - OptimGLEntLockForMultiuserEnv
  2. OBJECT Table 313 Inventory Setup, Automatic Cost Posting – OnValidateUse Legacy GL Entry Locking - OnValidate
  3. OBJECT Page 118 General Ledger Setup

Nothing ground-breaking yet, let’s continue and have a look at where function OptimGLEntLockForMultiuserEnv is used.

OBJECT Codeunit 80 Sales-Post
LOCAL PROCEDURE LockTables

LOCAL LockTables()
SalesLine.LOCKTABLE;
ItemChargeAssgntSales.LOCKTABLE;
PurchOrderLine.LOCKTABLE;
PurchOrderHeader.LOCKTABLE;
GetGLSetup;
IF NOT GLSetup.OptimGLEntLockForMultiuserEnv THEN BEGIN
GLEntry.LOCKTABLE;
IF GLEntry.FINDLAST THEN;
END;

LOCAL PROCEDURE SortLines

GetGLSetup;
IF GLSetup.OptimGLEntLockForMultiuserEnv THEN
  SalesLine.SETCURRENTKEY("Document Type","Document No.",Type,"No.")
ELSE
  SalesLine.SETCURRENTKEY("Document Type","Document No.","Line No.")

OBJECT Codeunit 90 Purch.-Post
LOCAL PROCEDURE LockTables

PurchLine.LOCKTABLE;
SalesOrderLine.LOCKTABLE;
GetGLSetup;
IF NOT GLSetup.OptimGLEntLockForMultiuserEnv THEN BEGIN
  GLEntry.LOCKTABLE;
  IF GLEntry.FINDLAST THEN;
END;

LOCAL PROCEDURE SortLines

GetGLSetup;
IF GLSetup.OptimGLEntLockForMultiuserEnv THEN
  PurchaseLine.SETCURRENTKEY("Document Type","Document No.",Type,"No.")
ELSE
  PurchaseLine.SETCURRENTKEY("Document Type","Document No.","Line No.");

OBJECT Codeunit 900 Assembly-Post
LOCAL PROCEDURE LockTables

AssemblyLine.LOCKTABLE;
AssemblyHeader.LOCKTABLE;
GetGLSetup;
IF NOT GLSetup.OptimGLEntLockForMultiuserEnv THEN BEGIN
  GLEntry.LOCKTABLE;
  IF GLEntry.FINDLAST THEN;
END;

LOCAL PROCEDURE SortLines

GetGLSetup;
IF GLSetup.OptimGLEntLockForMultiuserEnv THEN
  AssemblyLine.SETCURRENTKEY("Document Type",Type,"No.")
ELSE
  AssemblyLine.SETCURRENTKEY("Document Type","Document No.","Line No.");

LOCAL PROCEDURE SortPostedLines

GetGLSetup;
IF GLSetup.OptimGLEntLockForMultiuserEnv THEN
  PostedAsmLine.SETCURRENTKEY(Type,"No.")
ELSE
  PostedAsmLine.SETCURRENTKEY("Document No.","Line No.");

OBJECT Codeunit 5980 Service-Post
LOCAL PROCEDURE LockTables

ServiceLine.LOCKTABLE;
GLSetup.GET;
IF NOT GLSetup.OptimGLEntLockForMultiuserEnv THEN BEGIN
  GLEntry.LOCKTABLE;
  IF GLEntry.FIND('+') THEN;
END;

OBJECT Codeunit 5988 Serv-Documents Mgt.
LOCAL PROCEDURE SortLines

GLSetup.GET;
IF GLSetup.OptimGLEntLockForMultiuserEnv THEN
  ServLine.SETCURRENTKEY("Document Type","Document No.",Type,"No.")
ELSE
  ServLine.SETCURRENTKEY("Document Type","Document No.","Line No.");

Interesting! According to my understanding, the main difference between using “Use Legacy G/L Entry Locking” and not using it, are these lines:

Use Legacy GL Entry Locking - Main Difference

Which means, if we have a checkmark on “Use Legacy G/L Entry Locking” field, we ask the system to lock the G/L Entry table very early in the posting process. For example, in Codeunit 90, we would be locking G/L Entry table before we even started inserting purchase receipt header, posting receipt, etc. When we don’t have a checkmark, we allow system to decide when the table should be locked (which would happen at the end of the posting process, when table needs to be updated).

According to NAV Team blog, this small change results in:
– “Use Legacy G/L Entry Locking” field ticked (or NAV 2009) – G/L Entry is locked >90% of the time during sales/purchase post
– “Use Legacy G/L Entry Locking” field not ticked (or NAV 2013 and newer) – G/L Entry is locked <10% of the time during sales/purchase post

That is stunning!

Two other differences would be Рthe way lines are sorted, and how Automatic Cost Posting is being (or not being) run.

Further Reading:

Technorati Tags: , ,

Posted in Dynamics NAV / Navision | Tagged , , | Leave a comment