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.
0
Comments
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.
Cheers
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
MVP - Dynamics NAV
My BLOG
NAVERTICA a.s.
You may wish to change the code on the OnDelete trigger of the table as well.
Lead Consultant
Theta
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.
¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
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:
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.
¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯