Question about NAS

tompynationtompynation Member Posts: 398
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 B) 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

  • kinekine Member Posts: 12,562
    Take it from this point of view:if you are able to run some codeunit which will do that process from NAV client, you can only add this codeunit into the NASHandler under some new parameter and you are done. But you need some Codeunit which is singleinstance and will usetimer or will check some tables etc. to trigger the functionality. That's all. NAS is nothing more than NAV client without GUI, it is running what you start in CU1. That's all... :wink:
    Kamil Sacek
    MVP - Dynamics NAV
    My BLOG
    NAVERTICA a.s.
  • Captain_DX4Captain_DX4 Member Posts: 230
    Just a suggestion to avoid using the NAS:
    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.
    Kristopher Webb
    Microsoft Dynamics NAV Developer
  • ara3nara3n Member Posts: 9,256
    Another option is to use web service if you are going to upgrade to 2009.
    Ahmed Rashed Amini
    Independent Consultant/Developer


    blog: https://dynamicsuser.net/nav/b/ara3n
  • tompynationtompynation Member Posts: 398
    Just a suggestion to avoid using the NAS:
    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.

    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...
  • DenSterDenSter Member Posts: 8,304
    No that's not possible, you'd have to change every function call to include a company name, and modify every single record variable to change company as well. It's technically possible, but would require enormous amounts of code work.

    It's much easier to implement this using NAS
  • sergisoftsergisoft Member Posts: 37
    :-k
    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
Sign In or Register to comment.