If you want to change company you should go to File - Company - Open.
Any other way ? With coding perhaps ?
I only know with hyperlink but if different company navision ask for user id and password.
Thank you.
You can change a company by using the CHANGECOMPANY function of a record. This only allows you to access the data in the other company for that record within code. It does not automatically change the accessible company for the user.
You can change a company by using the CHANGECOMPANY function of a record. This only allows you to access the data in the other company for that record within code. It does not automatically change the accessible company for the user.
But be carefull, because ALL (tablerelations, records-variables in the triggers) other references to records are still in the ORIGINAL company!
Regards,Alain Krikilion No PM,please use the forum. || May the <SOLVED>-attribute be in your title!
There is no C/AL way to log into a company. If you realy need to do this automatically, you could use NAS. There have been a few threads about restarting NAS in a different company that may be helpful.
But be carefull, because ALL (tablerelations, records-variables in the triggers) other references to records are still in the ORIGINAL company!
Good to know! I have been using CHANGECOMPANY primarily to get customer records from one company into another. Just as a way to relieve data-entry personnel from too much extra work. We have separate companies setup in the database that correspond to different years of an event, so registrations come in year after year and we just copy them across.
But be carefull, because ALL (tablerelations, records-variables in the triggers) other references to records are still in the ORIGINAL company!
Good to know! I have been using CHANGECOMPANY primarily to get customer records from one company into another. Just as a way to relieve data-entry personnel from too much extra work. We have separate companies setup in the database that correspond to different years of an event, so registrations come in year after year and we just copy them across.
I found it out the hard way. When programming something, it didn't work for this reason, so I had to rewrite a lot.
Regards,Alain Krikilion No PM,please use the forum. || May the <SOLVED>-attribute be in your title!
Just stay away from VALIDATE and you should be fine, as long as your code sets the company for ALL record variables explicitly.
OOooh, is that what the issue was? I see. Well, that just makes sense. You can't VALIDATE on a table with a table relation unless the options exist, so that just makes good programming sense. *hehe* I've found the best way is to make the settings in some of the tables identical for every company, which a lot of Navision installations will do anyways (at least in my experience). Makes sense too. Payment Terms codes, for example, shouldn't be that radically different across companies in Navision, unless the client's functional companies are using radically different business rules. It just makes setup easier too.
Thank you guys.
Can i do posting to another company from another company ? Of course not. But, any other way to make it easier...coz, i'm dealing with a lot of companies, hundreds of companies....need a lot of people and need a lot of time to post something.
Essentially, no. I mean, there may be a way if you want to go through ALL the posting code and update everything to be able to post into another company, but even then I'm not sure if the CONSISTENT functionality would work.
Far easier to just have the users go into the new company to post.
Some trick I used once (before the NAS existed, now you might use the NAS).
A when posting sales invoice in one company had to create a purchase invoice in another company. Not being able to use the VALIDATE-triggers in the second company, I created information in new tables that were DataPerCompany=FALSE. When someone entered a company, I checked if there were invoice to be created and if there were, I checked in the user had enough permissions to do it. If yes, I put a confirmation-box to ask him to create the invoices, and if he answered yes, I just created them.
Regards,Alain Krikilion No PM,please use the forum. || May the <SOLVED>-attribute be in your title!
Comments
Microsoft Dynamics NAV Developer
No PM,please use the forum. || May the <SOLVED>-attribute be in your title!
I have case one database with a lot of companies.
Thank you.
Please explain more.
RIS Plus, LLC
I don't understand.
Thank you denster.
Independent Consultant/Developer
blog: https://dynamicsuser.net/nav/b/ara3n
Good to know! I have been using CHANGECOMPANY primarily to get customer records from one company into another. Just as a way to relieve data-entry personnel from too much extra work. We have separate companies setup in the database that correspond to different years of an event, so registrations come in year after year and we just copy them across.
Microsoft Dynamics NAV Developer
No PM,please use the forum. || May the <SOLVED>-attribute be in your title!
RIS Plus, LLC
OOooh, is that what the issue was? I see. Well, that just makes sense. You can't VALIDATE on a table with a table relation unless the options exist, so that just makes good programming sense. *hehe* I've found the best way is to make the settings in some of the tables identical for every company, which a lot of Navision installations will do anyways (at least in my experience). Makes sense too. Payment Terms codes, for example, shouldn't be that radically different across companies in Navision, unless the client's functional companies are using radically different business rules. It just makes setup easier too.
Cheers!
Microsoft Dynamics NAV Developer
Can i do posting to another company from another company ? Of course not. But, any other way to make it easier...coz, i'm dealing with a lot of companies, hundreds of companies....need a lot of people and need a lot of time to post something.
Far easier to just have the users go into the new company to post.
Why so many companies?
Microsoft Dynamics NAV Developer
A when posting sales invoice in one company had to create a purchase invoice in another company. Not being able to use the VALIDATE-triggers in the second company, I created information in new tables that were DataPerCompany=FALSE. When someone entered a company, I checked if there were invoice to be created and if there were, I checked in the user had enough permissions to do it. If yes, I put a confirmation-box to ask him to create the invoices, and if he answered yes, I just created them.
No PM,please use the forum. || May the <SOLVED>-attribute be in your title!
The top of this thread explains it fairly well. You need to create two record variables for the same table:
Var1Table1
Var2Table1
Then you need to invoke the CHANGECOMPANY function:
Var2Table1.CHANGECOMPANY('XYZ');
Then you can filter each of the variables and use them as normal:
Var2Table1.GET...
Var2Table1.SETRANGE...
Copy the variable:
Var1Table1.INIT;
Var1Table1 := Var2Table1;
Var1Table1.INSERT;
Microsoft Dynamics NAV Developer
I put the code in On Push Trigger in Contact Card. when i press the command button it shows "contact nunber is already exist".
what can I do???
Microsoft Dynamics NAV Developer