Hi Rick, I can sense that the force is strong with you :) ...
Internet [email protected] Sent by: [email protected] 12/18/2009 05:35 PM Please respond to [email protected] To [email protected] cc Subject Re: Why does the OpenGuide Method within a VB Script or C# program open two windows? ** Gee, my answer, based on the sender's email address, was going to be "These aren't the guides you're looking for". Yours is (as always) much better! Rick On Fri, Dec 18, 2009 at 2:09 PM, Mueller, Doug <[email protected]> wrote: ** Chike, Yes, it has been 6 weeks since you posted. Not a very timely response. But I notice no one else has responded to this issue while I was catching up with what I got behind with while I have been travelling. I cannot say for sure this is happening because I don't have your logic, but I will tell you what I think is happening. First, let me restate the problem to make sure I have it right. You are running a guide from the outside (by the way, the same thing would happen if you were on form Q that was unrelated to this guide and ran the guide). The guide is designed to open a window of a form in a specific view. The problem is that you get the form opened with the default view and also open in the view you want. So, let's look at this problem: I am going to say you have form A on the system and you create a guide and attach it to form A. It has an active link in it that opens form A. You are running the guide when NOT sitting on form A. What is happening is the following: You run the guide. The guide looks and says "Hey, I don't have the form I am tied to open so I have no context within which to run. So, I better open the form I am connected to so I have somewhere to run. This is the first window (in the default view which is not what you want). Now, the guide is comfortable with the environment it has and it runs the workflow of the guide. The active link fires and it opens a window. This is the second window (in the view you want). The issue is one of context. Workflow runs in the context of a form so the form must be there for the workflow to run. Without a context, the guide establishes one. IF the scenario changed so you were on form A when the guide was run, the guide is happy, it is on the form it is tied to so it starts running WITHOUT opening a new window to be the place where the guide runs. You have introduced workflow to close the first window. The challenge with that is how do you know you are in the right context to close that window vs. some context where the window is opening for a different purpose. A better option would be to create a simple display only form (with few to no fields on it). Tie the guide to that form. Have workflow on that form always close the window on window open (or maybe loaded and open a submit window) at a high execution order. Essentially, you want this window to be a dummy that is launched to allow your guide to have a context to run and close yourself. You always want to close as this isn't a real form. Make the form public/hidden so no one will try and select it. Now, you will not get the second window (well, you will of the dummy form, but it should close immediately, generally before it ever is painted). To be sure there is no interference, make the dummy form very small so even if it does show, it is a very small area that shows briefly before closure. You say you don't need context for this guide? You are right. But, we don't know that. We have an arbitrary guide with arbitrary actions which may or may not reference fields. We don't know so we require that workflow run within a context of a form. Note, if the guide is connected to multiple forms. If launched from ANY of the form types listed, it does not open a new window. Only if it is launched from none of them and then the window opened will be the primary form the guide is connected to. I hope this explains what happened in your case -- unless this is not happening, but it is a potentially useful description for others anyway. And, gives you ways to use the capability of the system to do what you want to accomplish in the best way. Doug Mueller From: Action Request System discussion list(ARSList) [mailto: [email protected]] On Behalf Of Ob1 Kenobi Sent: Tuesday, November 03, 2009 6:03 AM To: [email protected] Subject: Why does the OpenGuide Method within a VB Script or C# program open two windows? Importance: High ** Hi Listers, I have a situation where I need to open a particular view of a form so I've employed the use of the OpenGuide method call as advised by Chris Woyton. Thanks Chris! I'm trying to open view "A" even though the server's default view to open for this form is view "B". This cannot be changed! The program runs as expected and opens up the correct view in a submit window but I have another window opening up in the default view "B". I have checked all my workflow and I'm sure that I don't have any workflow opening up this extra window. The guide I'm calling is setup to only open up view "A" of the form in question. I've even gone as far as trying to close the other view (default view "B") by adding another active link that runs a close window action within the Guide. Problem with this approach is that the GetActiveForm() call may actually run on the form that was closed out rendering the View left behind useless. Question: 1. Is this the normal behavior for the OpenGuide call and if so, how can I prevent it from opening up 2 windows? 2. Has anyone else seen this behavior? TIA, Chike This message and any attachments (the "message") is intended solely for the addressees and is confidential. If you receive this message in error, please delete it and immediately notify the sender. Any use not in accord with its purpose, any dissemination or disclosure, either whole or partial, is prohibited except formal approval. The internet can not guarantee the integrity of this message. BNP PARIBAS (and its subsidiaries) shall (will) not therefore be liable for the message if modified. Please note that certain functions and services for BNP Paribas may be performed by BNP Paribas RCC, Inc. _Platinum Sponsor: [email protected] ARSlist: "Where the Answers Are"_ _Platinum Sponsor: [email protected] ARSlist: "Where the Answers Are"_ _Platinum Sponsor: [email protected] ARSlist: "Where the Answers Are"_ _______________________________________________________________________________ UNSUBSCRIBE or access ARSlist Archives at www.arslist.org Platinum Sponsor:[email protected] ARSlist: "Where the Answers Are"

