Friday, October 29, 2010

Dynamics NAV 2009 Web Service

Recently I have a chanced to work with a POS system solution provider to link back to NAV.

The POS System is developed using .NET platform, and they need to write back sales transaction and payment from the frontend (shops) back to backend, which is NAV.

This is our first time using MS Dynamics NAV Web Service for system integration.

What I have done is to publish the pages required which is the Sales Order page and Cash Receipt Journal Page. With these two pages published, the POS can insert & updata data into these two pages. Whatever fields that we published inside the page can be accessed by external.

For posting, we cannot just publish standard posting codeunit. There will be errors because normally for posting routine, we will pass the whole table record into codeunit. But from external, there will not have the record variable.

Thus, what I did is to create a new codeunit for any functions that I want to published to POS. For an example, for Sales Posting I have write a function to call standard posting Codeunit with 4 parameters as per below:
1. Document Type
2. Document No
3. Ship (Boolean)
4. Invoice (Boolean)

So the POS just need to my customized codeunit's posting function with the above mentioned parameters.

Still something new to us, but is it fun to explore.

: )