[CASE CLOSED]Maintain multi-company orders from one screen

couberpucouberpu Member Posts: 317
Merry Xmas to all of you,

I am facing a new request from my boss and I need help with ideas.

We are using 3.60 NAV with 3.70b runtime, sql options with SQL 2000. We had NAV modified to use a screen for salesperson to take orders while speaking to customer. It is same as sale order entry with added functions. The order entry process allows multi-locations and it would create multiple sales orders, one location one order, with one master order as link. We did this in two companies selling different type of products. Now we just opened up a new location in NYC and this location sells both product lines from both company. I created new locations in both company and run the new location without WMS. It worked great without much modification needed.

Now, due to tax and cost issues, we need to setup a new company for this location to operate more cost effective. Here is the request form my boss:
1. Do not change the existing order taking process and product replenish process.
2. Salesperson should be able to take the order from one screen and the program need to create sles oder in correct company.
3. Use usage from both company as replenishment qty to automatic create document for product replenishments.
4. All ledger entries need to be correct in all companies.

I am thinking about CHANGECOMPANY function. But also worry about the scale of modifications needed!

Please advise! :oops: :oops:

Thanks,
CouberPu

Comments

  • couberpucouberpu Member Posts: 317
    Well, This is what I have so far:

    I created a codeunit to follow the "setup list" to copy mater tables from both company into this nw company. Basic design is:
    IF Table.CHANGECOMPANY(<Company Name>) THEN BEGIN
      Table.RESET;
      REPEAT
        IF NOT TableinNewCompany.GET(KeySets...) THEN BEGIN
           TableinNewCompany.INIT;
           TableinNewCompany.COPY(Table);
           TableinNewCompany.INSERT;
        END;
      UNTIL Table.NEXT = 0;
    END;
    
    I also added two new fields in Location table: "Remote Company";Boolean & "Company Name";Text30. My thought was to check if "Remote Company" and CHANGECOMPANY to the "Company Name" before create the sales order.

    Still need help! :cry::cry:

    CouberPu
  • DenSterDenSter Member Posts: 8,305
    This is not an easy task by any means, especially with your level of customizations, and I would not use CHANGECOMPANY while creating orders in a different company, at least not directly on the standard tables.

    The thing with CHANGECOMPANY is that it only changes the company on the one record variable. When you validate a field, and the validation code in that field works with different record variables (which happens a LOT in your system), those other record variables have to be set with CHANGECOPANY as well to make everything work in that company.

    A better solution woud be to prepare staging records in one company, and read them from the other company in an automated process. Another solution might be to keep the two locations in the same company instead of setting up the locations as separate companies.

    This is one of those times when the requirement must be taken down and designed properly.
  • couberpucouberpu Member Posts: 317
    DenSter wrote:
    This is not an easy task by any means, especially with your level of customizations, and I would not use CHANGECOMPANY while creating orders in a different company, at least not directly on the standard tables.

    The thing with CHANGECOMPANY is that it only changes the company on the one record variable. When you validate a field, and the validation code in that field works with different record variables (which happens a LOT in your system), those other record variables have to be set with CHANGECOPANY as well to make everything work in that company.

    A better solution woud be to prepare staging records in one company, and read them from the other company in an automated process. Another solution might be to keep the two locations in the same company instead of setting up the locations as separate companies.

    This is one of those times when the requirement must be taken down and designed properly.

    Happy New Year again, Daniel,

    Using staging method is a good idea and might work better.

    One thing is not going to change: The bosses already decided on the business requirements and they are asking for the results. Which makes my job very easy: Just get the results. :roll:

    I knew there are lot of issues with our system and a proper design was needed. I just want to gather possibilities to meet boss' demands. Can we explorer the staging idea a little more?

    I want to continue using the two new fields in Location table: "Remote Company" & "Company Name". And it goes like these:

    1. Create two new tables: one for holding the data before processing and the other for mapping purpose.
    2. Modify the code to read inventory data, based on which location from which company, into the order processing screen. We call this screen "Stock Status Quick Quote" and it can do split orders based on locations.
    3. While creating the sales order in current company, using CHANGECOMPANY to write data into the staging table. This will only happen if the order has the need to creat order in other companies and only write the data to the staging table in other companies, with tableID and actionID(insert, modify,cancel...), without any validation.
    4. Add a automation process inplace for order creation. And possible replenishment, renaming, change....etc.
    5. Make the modification available to all companies so cross company sales can be done in any company.

    My knowledge with NAV is very limited and I only asking for the world. Please advise. :oops: :lol:

    Thanks,
    CouberPu
  • couberpucouberpu Member Posts: 317
    Well, I spend few hours to make Stock Status Quick Quote screen working with CHANGECOMPANY among companies and NOW I saw that it could be a mission impossible for me. And it is not fair to ask question here.

    Case closed and Thanks for reading it.

    CouberPu
Sign In or Register to comment.