Can a Template of Chart of Accounts be maintained.

ebrahmaebrahma Member Posts: 36
edited 2004-05-11 in Navision Attain
I want to maintain 5 companies in a database and all the 5 companies has uniform GL heads.

Will it be possible to maintain a Chart of accounts as template where if i create a GL head all the five will be updated and uniformity will be maintained.

How can i implement that.

Comments

  • Christian_BuehlChristian_Buehl Member Posts: 145
    You can create some code in the on Modify and in the on Insert Section that
    1. determines if you are in the template company
    (if companyname = ' template company')
    A much better way would be adding a field in the table company and check this

    2. Run through the table company (2000000006)
    3. with gl2.changecompany(companyname) you can change the focussed company for the table gl2

    Then look if the account exists, then create or change the account in record gl2 with transferfields and insert or modify

    Be aware of changing too much! I recommend to use the triggers in the modiy or insert (modify(true) or insert(true). And you may need some extra code for renaming the account.
  • Erik_EErik_E Member Posts: 17
    If u would like to have full uniformity just set the G/L table property "Data per company" to "NO", that way u will keep the same layout.

    Cheers
  • Greg06Greg06 Member Posts: 3
    Erik,

    Could you please let me know where I can find the "Data per Company" informations: I can't find it in the General Ledger Setup...
    Thx in advance :wink:
  • kinekine Member Posts: 12,562
    U must look into table properties - select line after last field (new line) in table designer and look at properties. It is properties for whole table. :-) - but this is a basic for programming in NA... 8)
    Kamil Sacek
    MVP - Dynamics NAV
    My BLOG
    NAVERTICA a.s.
  • Edward_BloomfieldEdward_Bloomfield Member Posts: 155
    You must be very, very careful if you change the Data per Company, becuase the code that checks if you should delete a G/L will still only check the entries in the company you are in but you will lose the G/L Account in all companies.

    You may wish to change the code on the OnDelete trigger of the table as well.
    Edward Bloomfield

    Lead Consultant
    Theta
  • RobertMoRobertMo Member Posts: 484
    edited 2004-05-11
    We use "DataPerCompany" at one of our customer. Main company is runing most of bussines functions, dependant company mostly enters documents and transtactions and runing reports.

    We set DataPerCompany=No to lot of tables (>60) and it is working perfectly.
    Of course you have to take care when deleting/renaming.

    You should have a lot of benefit since you are using more then 1 dependent company.
               ®obi           
    ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
  • RobertMoRobertMo Member Posts: 484
    Some more details when renaming a records regarding DataPerCompany
    You (probably) know that when you rename a record, also fields in others tables are changed, which have table relation to our renamed record.

    When using DataPerCompany this is not always true. Look at the following table to cover all 4 possibities. (Customer and Country tables are used for e.g. and we know that field "Customer"."CountryCode" has table relation to "Country")

    If we rename record in "Country" table:
    ---------------------------------------------------
    | DataPerCompany= |                               |
    ---------------------------------------------------
    |Country |Customer| "Customer"."Country Code" is: |
    ---------------------------------------------------
    |  Yes   |  Yes   | Changed                       |
    |  Yes   |  No    | NOT Changed                   |
    |  No    |  Yes   | Changed                       |
    |  No    |  No    | Changed                       |
    ---------------------------------------------------
    

    As you see the potential danger is setting Customer as DataPerCompany=No as this table has a lot of fields with table relations to other tables.
               ®obi           
    ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
Sign In or Register to comment.