In any screen change company and return into

Hello everybody, That made some time already that i’m searching if :[?][?] Is it possible, in any screen for exemple : in the order form, to change the company and automatically return in this form ? Thanks for your answer [:)]

to my knowledge: it is not possible for 2 reasons: A: since navision closes every single object if you close a company, and changing company means closing and opening i guess. so you wont have a chance to remember wherer you’ve been before, unless you write it somewhere into the DB or the filesystem. B: you would have to find a way where you can change the company directly from CAL code, but as i have read before on the forum here, i dont think thats possible.

You could probably change the company using Excel Automation and SendKey, but then, how would you know which form to open? You would have to put code into each form to perform the SendKey, with the current form’s number as parameter. And SendKey would have to start some codeunit and pass it the form’s number… and so on and so forth… In short, I don’t think it will be worth the effort, if it is possible at all.

quote:


Originally posted by xorph
You could probably change the company using Excel Automation and SendKey, but then, how would you know which form to open? You would have to put code into each form to perform the SendKey, with the current form’s number as parameter. And SendKey would have to start some codeunit and pass it the form’s number… and so on and so forth… In short, I don’t think it will be worth the effort, if it is possible at all.


Hi, I think it is possible to save the form and record where you are you can create a shortcut hyperlink. but the problem is quit navision with the automation sendkey alt F4 is ok but how automatically run the shortcut to execute the hyperlink created?

Hm, I haven’t tried this (at least not on purpose [;)]), but when you start Excel via Navision Automation and then quit Naivsion, Excel should remain running and executing any VBA macros contained in the current document (which you would have to open and run from Navision before quitting). At least during development, when Navision crashes, Excel and Word keep on running [:)] The shortcut should be executable by finding the corresponding .lnk file and executing it with the windows API functions (ShellExecute etc.). All this being a somewhat complex issue, let’s ask the other way round: What do you need this for? What is it you are trying to achieve? Maybe there’s a better and easier approach…

quote:


Originally posted by xorph
Hm, I haven’t tried this (at least not on purpose [;)]), but when you start Excel via Navision Automation and then quit Naivsion, Excel should remain running and executing any VBA macros contained in the current document (which you would have to open and run from Navision before quitting). At least during development, when Navision crashes, Excel and Word keep on running [:)] The shortcut should be executable by finding the corresponding .lnk file and executing it with the windows API functions (ShellExecute etc.). All this being a somewhat complex issue, let’s ask the other way round: What do you need this for? What is it you are trying to achieve? Maybe there’s a better and easier approach…


Thanks for answer [:)] In fact my customer is a fiduciary . So he want to create all the invoice of all the companies at the same time and not change always the companie, and so remain in the invoice form [:(].

quote:


Originally posted by marvax
So he want to create all the invoice of all the companies at the same time and not change always the companie, and so remain in the invoice form [:(].


Hmpf. If I had to do the job of entering all the invoices, I would sort them by company and do the work block after block instead of switching company after each invoice… I mean, he would somehow have to do the switching anyways, even if the form comes up automatically after the switch. But then, I’m a programmer, not a user [:p]

quote:


Originally posted by xorph

quote:


Originally posted by marvax
So he want to create all the invoice of all the companies at the same time and not change always the companie, and so remain in the invoice form [:(].


Hmpf. If I had to do the job of entering all the invoices, I would sort them by company and do the work block after block instead of switching company after each invoice… I mean, he would somehow have to do the switching anyways, even if the form comes up automatically after the switch. But then, I’m a programmer, not a user [:p]


I am agree with you, but he doesn’t want change his working method

well you could always suggest him to open two sessions =) or if he just needs to LOOK at the invoices without changing anything you could also create a 2nd form and retrieve the data from another company (RecordVar.CHANGECOMPANY) but then again, you’d have to edit every form inside navision … well =)

quote:


Originally posted by ahed4
well you could always suggest him to open two sessions =) or if he just needs to LOOK at the invoices without changing anything you could also create a 2nd form and retrieve the data from another company (RecordVar.CHANGECOMPANY) but then again, you’d have to edit every form inside navision … well =)


Two sessions by user : it is very expensive [B)] I can’t use changecompany because when he will post (F11) the document, changecompany doesn’t work [V] well !!! (in the CU90,12…)

quote:


Originally posted by marvax
I am agree with you, but he doesn’t want change his working method


Can you charge him for the necessary adaptations? Do you need a subcontractor? [:D][}:)]