Posting for many companies at the same time

S0918423470S0918423470 Member Posts: 159
Hello All,

I have an issue.
My database have 3 companies A,B,C

At company A : I create an Sales Order , i also create this SO for B,C
I stay at company A posting SO, after commit posting i want to continue posting SO at B and C (still at company A, not change company).

Method Changecompany only used with variable record not effect to codeunit.
I just read some posts at mibuso about Changecompany.

How can we solve this case without using NAS?

I can copy data from A to B,C after posting, but i don't want to do this because this is ok with new created entries but some entry will be modified cannot know to modify.

Thanks,
HN

Comments

  • kinekine Member Posts: 12,562
    Do not hope into solution without NAS. It's not the NAV way. If you have 3 companies, it means that they are separated. It means different responsibility of different people. How can I force of posting some document in company in which I am not employee? Or I have no responsibility for that? I do not know whole background, but this must be solved before you will create such a functionality...

    And because you cannot "fully" change company in code (as you already know you can just for the specific table but without application logic), there is just one way - SendKeys - but in this process, there is no 100% warranty that it will work, mainly because you are closing and opening another company and it means descarding all objects in memory. NAS is best way because you just needs functionality which will post order you tell that you want to post and you can do that through some shared table. Than you just needs simple function going through this table and posting all orders. You need one NAS per each company you want to automatically post.
    Kamil Sacek
    MVP - Dynamics NAV
    My BLOG
    NAVERTICA a.s.
  • MbadMbad Member Posts: 344
    Basicly you cant.
  • S0918423470S0918423470 Member Posts: 159
    Hello kine,

    I really dont want to use NAS,because i have not enough knowledge about NAS, i'm not confident to use NAS, but unfortunately for me there is no way to do that.

    Could you please guide me using NAS in my case?? In this case, we use Ms Navision SQL option.

    Thanks,
    HN
  • kinekine Member Posts: 12,562
    You can find more in documentation, on this forum (search for NAS) and some example is in download section. You just needs to have one on your mind: NAS is just common NAV Client but without gui. It means if you are able to work with C/AL and NAV client, you know how to work with NAS.
    Kamil Sacek
    MVP - Dynamics NAV
    My BLOG
    NAVERTICA a.s.
  • S0918423470S0918423470 Member Posts: 159
    Hello kine,

    Thanks for your suggestions. I will start to learn NAS :D
    But may i ask you one more question :

    In my case, when i have sale order in company A, i will auto copy this SO for company B,C, after that i post this SO and also post SO in company B,C. if there are any changes about inventory at Company B,C , company A also must be changed. SO works on the location that have warehouse activities. It's means that , we must make the warehouse shipment, after Create Pick, we post Invoice, Maybe these steps are not continuous because it depends on real action. NAS is used in this case that is ok, isn't it??It means that it can do these steps like we do mannually??

    Thanks,
    HN
  • cnicolacnicola Member Posts: 181
    Hi HN,

    Why don't you tell us what you are actually trying to achieve from a business perspective? Perhaps there might be a different way to do it ...
    To me what you are asking sounds pretty convoluted.

    Regards,
    Cristi Nicola
    Apathy is on the rise but nobody seems to care.
  • kinekine Member Posts: 12,562
    cnicola wrote:
    Hi HN,

    Why don't you tell us what you are actually trying to achieve from a business perspective? Perhaps there might be a different way to do it ...
    To me what you are asking sounds pretty convoluted.

    Regards,
    Cristi Nicola

    I agree.
    Kamil Sacek
    MVP - Dynamics NAV
    My BLOG
    NAVERTICA a.s.
  • S0918423470S0918423470 Member Posts: 159
    Hello kine,cnicola

    Thanks alot because of your replies.

    Sorry about my question, it is not clearly cause of my misunderstanding.

    Company B,C produce finished goods, after that they send these items to company A to sell. Company A is only Sales Company. When A make an Sale Order, when user posts SO, the system must recognize that items belong to B or C to seperate invoices to B and C invoice and at the same time making Sale Invoice at B,C and system post these invoice automatically. When customer make a payment, they will pay at company A, user at company A will apply to invoices, at this time system duplicates payment corresponding to B,C invoices at company B,C.

    I want to use the system's posting to limit risks.

    I try to use NAS to do that.I just tested NAS to post journal. I used codeunit 231 , i wrote my function to do that.
    It seems ok, but in the Event Viewer i have 'You cannot use C/AL variables of type DIALOG when running the Microsoft Business Solutions-Navision Application Server.'. because codeunit for posting in Navision always have Window.update() to show how many lines were posted. If i want to use NAS i must disable this thing. This way is ok but i think it good solution.

    I hope NAV can support another way, that not need customization.
    Another solution for this business case??

    Thanks,
    HN
  • cnicolacnicola Member Posts: 181
    Hi HN,

    I am not very familiar with Intercompany postings but that is a Navision standard functionality that does just that (I think) in 4.0 and 5.0. So if you have that you could probably take a look at it.
    Otherwise by the sounds of it, you do not have to transfer the transactions real time. So then you can do what Intercompany does in a simplified way. You create a new table in companies B and C which stores which SOs are being posted in Company A.
    When you post an SO in Company A you fill in that table in companies B and C using Changecompany (since it is an intermediary table you do not need any validation to take place). Then you have a periodic (or manual) routine in company B and C that reads that table and creates the appropriate documents (with appropriate validations).
    I think it is a lot easier and simpler than using NAS.

    Just a thought,
    Cristi Nicola
    Apathy is on the rise but nobody seems to care.
  • S0918423470S0918423470 Member Posts: 159
    Hi cnicola,

    Because we can not post SO for multi companies at the same time, so we make an a duplicate SO for B,C and after that at the end of the day, we schedule posting them. User dont want to post these SO and they also have not permission to do that, so we have to do that.

    Intercompany is not suitable in this case because Intercompany you make SO in A, in company B it becomes PO. Its mean is not right.
    In fact, Company B,C don't have sale function and not have Sale s person do to that, only Sales department can do, but sale department have not permission to access B,C that is why they need company A to do that and everything is posted automatically.

    Thanks,
    HN
  • MbadMbad Member Posts: 344
    Using NAS is the right way to go.

    If you need to post your jnl. lines you should post them directly to CU 12 instead. What you are running is a post batch and that will make the pop-up. Instead you need to post every line individually or change the post batch in CU 13 to use guiallowed(false).
  • cnicolacnicola Member Posts: 181
    Hi Mbad and HN,

    First of all you should always discuss the business issue not the technical implementation.

    If you have 2 actual companies A and B and one is a producer and then another is a distributor then I think legally (at least in US) you do generate an SO in company A (distributor) that translates into a PO for company B as a vendor and then to make things easy you create an SO in company B for company A as a customer. From what HN is saying he wants to duplicate the same SO in multiple companies. So then it has to be one of the following:

    a) Vietnam has a wildly different legal framework than US and you can generate multiple invoices for same customer from different companies for the same product.
    b) You use what I mentioned before as a way to transfer things.
    c) I would have to question the reason for having separate companies.

    As for a technical reason what you are trying to achieve is get some basic info from one company to another to generate and post a document.
    Yes you can do it with NAS by transferring some XML file or something or simply reading the orders from A while in B.
    But you could just as well write a routine that runs on a scheduler that is a lot easier to maintain and troubleshoot than deal with than NAS.
    I will give you that you can do it either way from a technical perspective but I am still worried about the business reasons for doing it.
    Apathy is on the rise but nobody seems to care.
Sign In or Register to comment.