Giving Focus to a field

To add to Jose's comment, the trick is to get your code to fire AFTER any code the Epicor has designed to place the focus somewhere. Sometimes it is as simple as putting it in the load form, other times it take more. Frequently other events will happen that adjust the focus, you might put some after adapter events and message boxes into your code and follow the events. If you can document all the events that might be changing the focus you can put your code into these after events to reset the focus. Even with that you may lose the battle.

something a bit kludgey might be to get a reference to the control that Epicor is putting the focus on and add a got focus event to it. Then when this event happens under certain conditions you set the focus to the control you want it to be.

Jim Kinneman
Encompass Solutions, Inc

--- In vantage@yahoogroups.com, "Anon" <jgiese@...> wrote:
>
> Does what you say imply that there is no way to auto focus a field on some screens even with the code in place to do so? I have the HH Bin Tracker setup that I want the Bin Number to be the field focused first and it just won't do it. I have the tab index where it is number 1 and have the following code on the _Load sub
>
> Dim txtBinCt As EpiTextBox = ctype(csm.GetNativeControlReference("d085649e-8d5c-43a1-a8b9-d3a2a6034391"),EpiTextBox)
>
> txtBinCt.focus
>
> --- In vantage@yahoogroups.com, Jose Gomez <jose@> wrote:
> >
> > On Form Load you can do Control.Focus
> > however Epicor in a lot of instances handles the focus for you and it will
> > get overriten
> >
> > *Jose C Gomez*
> > *Software Engineer*
> > *
> > *
> > *checkout my new blog <http://www.usdoingstuff.com> *
> > *
> > *T: 904.469.1524 mobile
> > E: jose@
> > http://www.josecgomez.com
> > <http://www.linkedin.com/in/josecgomez> <http://www.facebook.com/josegomez>
> > <http://www.google.com/profiles/jose.gomez> <http://www.twitter.com/joc85>
> > <http://www.josecgomez.com/professional-resume/>
> > <http://www.josecgomez.com/feed/>
> > <http://www.usdoingstuff.com>
> >
> > *Quis custodiet ipsos custodes?*
> >
> >
> >
> > On Tue, Apr 17, 2012 at 10:56 AM, altyrocks <alty_rocks@> wrote:
> >
> > > **
> > >
> > >
> > > Hello, is there a way to force the cursor to appear in a field when the
> > > window is opened? On the Customer Shipment Entry screen, we have assigned
> > > the PackOut tab as the initial tab. We would like to have the Order Number
> > > be in focus. Setting the tab index doesn't appear to accomplish this.
> > >
> > >
> > >
> >
> >
> > [Non-text portions of this message have been removed]
> >
>
Hello, is there a way to force the cursor to appear in a field when the window is opened? On the Customer Shipment Entry screen, we have assigned the PackOut tab as the initial tab. We would like to have the Order Number be in focus. Setting the tab index doesn't appear to accomplish this.
On Form Load you can do Control.Focus
however Epicor in a lot of instances handles the focus for you and it will
get overriten

*Jose C Gomez*
*Software Engineer*
*
*
*checkout my new blog <http://www.usdoingstuff.com> *
*
*T: 904.469.1524 mobile
E: jose@...
http://www.josecgomez.com
<http://www.linkedin.com/in/josecgomez> <http://www.facebook.com/josegomez>
<http://www.google.com/profiles/jose.gomez> <http://www.twitter.com/joc85>
<http://www.josecgomez.com/professional-resume/>
<http://www.josecgomez.com/feed/>
<http://www.usdoingstuff.com>

*Quis custodiet ipsos custodes?*



On Tue, Apr 17, 2012 at 10:56 AM, altyrocks <alty_rocks@...> wrote:

> **
>
>
> Hello, is there a way to force the cursor to appear in a field when the
> window is opened? On the Customer Shipment Entry screen, we have assigned
> the PackOut tab as the initial tab. We would like to have the Order Number
> be in focus. Setting the tab index doesn't appear to accomplish this.
>
>
>


[Non-text portions of this message have been removed]
Use the wizard form event to do a form load event.. try

Dim nbrOrder As EpiNumericEditor = ctype(csm.GetNativeControlReference("31799c26-7331-45b0-a723-9cc464175117"),EpiNumericEditor)
NbrOrder.focus


Replace 31799c26-7331-45b0-a723-9cc464175117 with the GUID of the specific control you want to focus on..




Rob Bucek
Production Control Manager
PH: (715) 284-5376 ext 311
Mobile: (715)896-0590
FAX: (715)284-4084
[Description: cid:1.234354861@...]<http://www.dsmfg.com/>
(Click the logo to view our site)<http://www.dsmfg.com/>

From: vantage@yahoogroups.com [mailto:vantage@yahoogroups.com] On Behalf Of altyrocks
Sent: Tuesday, April 17, 2012 9:57 AM
To: vantage@yahoogroups.com
Subject: [Vantage] Giving Focus to a field



Hello, is there a way to force the cursor to appear in a field when the window is opened? On the Customer Shipment Entry screen, we have assigned the PackOut tab as the initial tab. We would like to have the Order Number be in focus. Setting the tab index doesn't appear to accomplish this.



[Non-text portions of this message have been removed]
That worked great, thanks! I'm using C# so here's the final code for future searches:

EpiTextBox txtOrderNum = (EpiTextBox)csm.GetNativeControlReference("8e8baac3-68d9-424c-8b27-e3e3c08e6bf5");

txtOrderNum.Focus();

--- In vantage@yahoogroups.com, Rob Bucek <rbucek@...> wrote:
>
> Use the wizard form event to do a form load event.. try
>
> Dim nbrOrder As EpiNumericEditor = ctype(csm.GetNativeControlReference("31799c26-7331-45b0-a723-9cc464175117"),EpiNumericEditor)
> NbrOrder.focus
>
>
> Replace 31799c26-7331-45b0-a723-9cc464175117 with the GUID of the specific control you want to focus on..
>
>
>
>
> Rob Bucek
> Production Control Manager
> PH: (715) 284-5376 ext 311
> Mobile: (715)896-0590
> FAX: (715)284-4084
> [Description: cid:1.234354861@...]<http://www.dsmfg.com/>
> (Click the logo to view our site)<http://www.dsmfg.com/>
>
> From: vantage@yahoogroups.com [mailto:vantage@yahoogroups.com] On Behalf Of altyrocks
> Sent: Tuesday, April 17, 2012 9:57 AM
> To: vantage@yahoogroups.com
> Subject: [Vantage] Giving Focus to a field
>
>
>
> Hello, is there a way to force the cursor to appear in a field when the window is opened? On the Customer Shipment Entry screen, we have assigned the PackOut tab as the initial tab. We would like to have the Order Number be in focus. Setting the tab index doesn't appear to accomplish this.
>
>
>
> [Non-text portions of this message have been removed]
>
Does what you say imply that there is no way to auto focus a field on some screens even with the code in place to do so? I have the HH Bin Tracker setup that I want the Bin Number to be the field focused first and it just won't do it. I have the tab index where it is number 1 and have the following code on the _Load sub

Dim txtBinCt As EpiTextBox = ctype(csm.GetNativeControlReference("d085649e-8d5c-43a1-a8b9-d3a2a6034391"),EpiTextBox)

txtBinCt.focus

--- In vantage@yahoogroups.com, Jose Gomez <jose@...> wrote:
>
> On Form Load you can do Control.Focus
> however Epicor in a lot of instances handles the focus for you and it will
> get overriten
>
> *Jose C Gomez*
> *Software Engineer*
> *
> *
> *checkout my new blog <http://www.usdoingstuff.com> *
> *
> *T: 904.469.1524 mobile
> E: jose@...
> http://www.josecgomez.com
> <http://www.linkedin.com/in/josecgomez> <http://www.facebook.com/josegomez>
> <http://www.google.com/profiles/jose.gomez> <http://www.twitter.com/joc85>
> <http://www.josecgomez.com/professional-resume/>
> <http://www.josecgomez.com/feed/>
> <http://www.usdoingstuff.com>
>
> *Quis custodiet ipsos custodes?*
>
>
>
> On Tue, Apr 17, 2012 at 10:56 AM, altyrocks <alty_rocks@...> wrote:
>
> > **
> >
> >
> > Hello, is there a way to force the cursor to appear in a field when the
> > window is opened? On the Customer Shipment Entry screen, we have assigned
> > the PackOut tab as the initial tab. We would like to have the Order Number
> > be in focus. Setting the tab index doesn't appear to accomplish this.
> >
> >
> >
>
>
> [Non-text portions of this message have been removed]
>