Hi,
We have more than 100 companies on navision, we will harmonize the tables to be consistent.
What I'd like to do:
If for example I want to add a vendor in a 'master company ', this vendor is automatically add in all my other company.
Have you ever done this? Can you give me advice?
Thanks for help
Sylvain
Comments
I guess that seems to be possible with a little bit of customization -
1. On insert, modify triggers of the vendor table you can write a code which will follow like -
a) change the company via code. (ChangeCompany)
b) copy the record and insert in the changed company.
Thanks & Regards,
Saurav Dhyani
Do you Know this About NAV?
Connect - Twitter | Facebook | Google + | YouTube
Follow - Blog | Facebook Page | Google + Page
I have an other question, If i put changecompany code on the trigger, i have to LOOKED the table in the other company or not?
Because if an other user is on the vendor table maybe i will me problematic ?
Can we use VALIDATE function with ChangeCompany?
Thanks for sharing your experience (and sorry for my english)
You may want to take a look at the STARTSESSION-command that was introduced in NAV 2013. It allows you to start a session with a specified codeunit (e.g. your codeunit that creates your vendor) and a chosen company name. Contrary to changecompany this really changes the entire context to that company.
If you wrap that STARTSESSION-command in a loop on the company table it will be called for all companies. The tricky part is probably more logical than technical since you will have to take care of all related tables to avoid table relation violation.
I hope this helps!
Regards,
Julian