How to changecompany directly

wiro
Member Posts: 92
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.
Any other way ? With coding perhaps ?
I only know with hyperlink but if different company navision ask for user id and password.
Thank you.
0
Comments
-
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.Kristopher Webb
Microsoft Dynamics NAV Developer0 -
Captain DX4 wrote: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.Regards,Alain Krikilion
No PM,please use the forum. || May the <SOLVED>-attribute be in your title!0 -
I know changecompany. But it's only open a record. record.changecompany(companyname).
I have case one database with a lot of companies.
Thank you.0 -
What is it you want to do? Maybe there are other ways?
Please explain more.0 -
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.0
-
Forgive my ignorance, what do you mean by threads?
I don't understand.
Thank you denster.0 -
by threads he means topics that other people were discussing. Search for it and you'll find the discussion on mibuso.0
-
kriki wrote: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.Kristopher Webb
Microsoft Dynamics NAV Developer0 -
Captain DX4 wrote:kriki wrote: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.Regards,Alain Krikilion
No PM,please use the forum. || May the <SOLVED>-attribute be in your title!0 -
Just stay away from VALIDATE and you should be fine, as long as your code sets the company for ALL record variables explicitly.0
-
DenSter wrote: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.
Cheers!Kristopher Webb
Microsoft Dynamics NAV Developer0 -
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.0 -
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.
Why so many companies?Kristopher Webb
Microsoft Dynamics NAV Developer0 -
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!0 -
how can i copy record from one company to another company?? i dont want all data i want only selected records transfered to another company??0
-
kishi_g wrote:how can i copy record from one company to another company?? i dont want all data i want only selected records transfered to another company??
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;Kristopher Webb
Microsoft Dynamics NAV Developer0 -
Hi Captain DX4,
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???0 -
I think you want to establish a new record first, based on the primary key, and then only copy fields that don't overwrite the primary key fields.Kristopher Webb
Microsoft Dynamics NAV Developer0
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.6K Microsoft Dynamics NAV
- 18.7K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 116 Navision DOS
- 851 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 617 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 320 Dynamics CRM
- 111 Dynamics GP
- 10 Dynamics SL
- 1.5K Other
- 990 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 35 Design Patterns (General & Best Practices)
- 1 Architectural Patterns
- 10 Design Patterns
- 5 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1.1K General Chat
- 1.6K Website
- 83 Testing
- 1.2K Download section
- 23 How Tos section
- 252 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions