I need to configure the NAS so that it works as follows.
I have 2 companies A & B.
Company A doesnt have a real stock, it buys everything from Company B
1. I create a Sales Order in company A,
2. The user press a process button and a Purchase Order (in the same Company) gets created for a Vendor. This vendor
exists in Company B as a Customer.
3. Now the NAS should get Triggered when this Purchase Order gets created, so that it calls a Custom CodeUnit which
create a Sales Order (in Company
from the Purchase Order (in Company A).
How can i achieve this...
I got all the needed code for doing this processing. It's just the NAS that i need to configure correctly...
Any help/links/info on how to configure the NAS like this would be much appreciated.
Thanks
Comments
MVP - Dynamics NAV
My BLOG
NAVERTICA a.s.
Consider how many tables your code uses to create the SO in Company B. If it's not too many, you can just write code to create records in Company B and trigger it directly from the same process the creates the Purchase Order in Company A in the first place.
Microsoft Dynamics NAV Developer
Independent Consultant/Developer
blog: https://dynamicsuser.net/nav/b/ara3n
But how can i trigger it directly from the same process that creates the Purchase Order in Company A...
The Code Unit that creates the Sales Order in Company B should be executed in Company B, so that the validates are working correctly.
Or is there any way that i can make that code unit run in Company B, while i'm in Company A.
If so then i wouldnt need the NAS server i guess...
It's much easier to implement this using NAS
RIS Plus, LLC
MVP - Business Apps
Another solution is doing that:
1.- Create 1 (or 2; one for header and another for lines) Non-data-per-company table and use it as a queue for validate the most important hedader fields (Customer, Shipment Address) and most important line fields (Type, No, Quantity, Unit price, etc). This table should have a boolean field to indicate if it is processed or not.
2.- Type code in you button to create regs at this new table.
3.- Create a new Codeunit with the property single-instance set to True and place there a Timer automation. This timer automation will create the new order on company B using not processed data stored on your new table.
4.- Inside codeunit 1, trigger NASHandler (Number 99 in text mode), place a call to this new codeunit.
Your NAS has to be configured to log in company B, it will execute your codeunit "forever". =D>
Another option is use all steps from 1 to 2 but using a report to do steps 3 and 4 and place it on the navision Task Scheduler (Navision Task Scheduler never fails :^o )
Sergi Navarro
MCTS: Microsoft Dynamics™ NAV 2009 C/SIDE Solution Development
Visit my Navision Spanish Blog here: http://www.sergisoft.com