Global CHANGECOMPANY

dagviggo
Member Posts: 20
Does anybody have any suggestions on how to post orders from a NAS client to different companies.
Here's what I'm trying to do...
I have a NAS client that listens to reqests from a web site. And this web site "talks" to several companies in Navision thru heavy use of CHANGECOMPANY. In most cases this works fine, but when we get to posting for instance orders in Navision this gets complicated.
Because Codeunit 80 calls a bunch of different functions and uses several tables.
What I really would love is to be able to changecompany globall within the current client, then my problem would be solved. But no such thing exists as far as I know.
Any help would be appreciated!
Here's what I'm trying to do...
I have a NAS client that listens to reqests from a web site. And this web site "talks" to several companies in Navision thru heavy use of CHANGECOMPANY. In most cases this works fine, but when we get to posting for instance orders in Navision this gets complicated.
Because Codeunit 80 calls a bunch of different functions and uses several tables.
What I really would love is to be able to changecompany globall within the current client, then my problem would be solved. But no such thing exists as far as I know.
Any help would be appreciated!
0
Comments
-
Is this because you speak about "Global" subject that you make a Global Request in all the sections ? :whistle:0
-
As far as I know, this is not possible.
What we did:
We use 2 NAS clients. One controls the other. for changing company: it stops the service, it changes the parameters, and it starts the service again. This way, it can post whatever it wants... without worrying about CHANGECOMPANY...0 -
Sorry about the multiple posts! I was afraid that would miss some geniuses out there.0
-
Thanks Waldo, that sound like a great idea - eventhough I don't have any idea of how to start/stop services from within NAS, but we'll look into it.
Maybe, another post arises after a few trials and errors0 -
well,
we wrote a seperate DLL that does this ... quite easy in VB.NET. Else you would run a shell-command like "NET STOP" and "NET START" to stop and start services.
Basically the DLL does the following:
- Stop service
- Change registry settings (for the NAS)
- Start service0 -
That's true, I didn't think of NET START/STOP. But there's one thing I'm wondering about.
Does your DLL routine wait for the NAS process to complete before closing it and preparing the next request.
If it doesn't, then you would need X number of NAS clients, depending on how many reqests there are before the first one finishes.
And NAS clients costs money
Are you with me?!0 -
that's what I thought. We'll try with at loop in NAS1 that waits for NAS2 to finish.
Thanks a lot, we have come a long way today0 -
What about something as "switch"? It is some NAS which get the message, look at it and send it to target NAS based on the Company you need. (one NAS for each company + 1 NAS switch). The switch can be something else, not NAS.0
-
Yes, to not need CHANGECOMPANY, you start NAS for each company (problem is only licenced sessions for NAS).
a) you send request to one of the NAS, it look at it, see that it is for his company (then process it) or it is for another company (than forward it to another NAS)
b) you have extra NAS, which take the request and forward it to apropriate NAS for the company...variant A request | NAS2 | \ NAS3 NAS4 variant B request | NAS1--------- / \ \ NAS2 NAS3 NAS4
Where NAS1 is the 'switch NAS', NAS2 is NAS for Company1, NAS3 is NAS for Company 2, NAS4 for Company 3 etc...[/quote]0 -
You need NAS session for each NAS (one you have for free) + one for the 'switch' if you do it with NAS (it can be another application)...0
-
One more thing Waldo, you with the experience
...
What is the performance like?!? When you all the time have to, start NAS, then wait for process to finish and then close NAS, when processing requests.0 -
-
What about creating a bool var + Origin Var in one company1, create the bill from company2 making this bill as "automatic-post/don't-show" and "Origin". Then to also have a infinite loop in company 1(spare PC1) that checks and posts all those bills and mark in Company 2 the origin bill for them all. Then a second loop in company 2 (spacre PC2) that checks all "Waiting bills" and post them when receiving the confirmation from company 1.
That would take 2 sessions and no need to post from another company (which is impossible unless you want to duplicate all posting codeunits and related) That will also allow people like me which doesn't have a dumb about how to create a dll to do so. Rolling Eyes
The only problem would be to control the waiting bills (presumably you would hide those from the regular forms).
PD: Sorry, adminNavision 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