Hot Topic (More than 10 Replies) Limiting automatic lookup (Read 1751 times)
JohhnyB
Member
*
Offline


No personal text

Posts: 23
Joined: Apr 28th, 2004
Limiting automatic lookup
May 3rd, 2004 at 9:04pm
Print Post Print Post  





I come from a AS/400  RPG programming background, where if i want to do a lookup on a field,   i activate a command key in the program and then put some verbage on the bottom of the screen that says "use command key 4 to lookup".   so if the user doesn't need to look up,  he doesn't use command key 4.   In Sesame,  it seems like  you don't have that flexibility.  in element entry,  as soon as the cursor enters the field  up pops the lookup.  which forces the use to escape out of it.  unneccesaary key stroke and thought process .any other way to provide a lookup with out having it activate automatically??   I did couple the code with "Only when the field is blank".   But that isn't all that helpful when in update or even add mode.
  
Back to top
 
IP Logged
 
Hammer
YaBB Administrator
Lanticans
*****
Offline


Fire bad. Tree pretty.

Posts: 3436
Location: Ohio
Joined: Nov 22nd, 2002
Re: Limiting automatic lookup
Reply #1 - May 5th, 2004 at 11:57am
Print Post Print Post  
You want to wrap your lookup in an If condition. What that If condition checks is up to you. You can check for blankness or mode or a combination of the two, etc. If you can describe the conditions under which you want the lookup to occur, someone may be able to provide more detailed help.
  

- Hammer
The plural of anecdote is not data.
Back to top
IP Logged
 
JohhnyB
Member
*
Offline


No personal text

Posts: 23
Joined: Apr 28th, 2004
Re: Limiting automatic lookup
Reply #2 - May 5th, 2004 at 4:47pm
Print Post Print Post  
Well, an "If condition"  really doesn't cut it.   Unless you can use another command key being on?   can you do that?  if i touch F4,  then do the lookup what ever field the cursor is on?
  
Back to top
 
IP Logged
 
JohhnyB
Member
*
Offline


No personal text

Posts: 23
Joined: Apr 28th, 2004
Re: Limiting automatic lookup
Reply #3 - May 5th, 2004 at 7:47pm
Print Post Print Post  
it occurred to me that you could program a popup type radio button or something that will do the lookup when it is pressed.   wouldn't need to use "on element entry or "element change"  .  i think i saw a Calendar button like that in one of the examples. 

as you can tell,  i am just learning my way with this product. a very big change for me.
  
Back to top
 
IP Logged
 
Hammer
YaBB Administrator
Lanticans
*****
Offline


Fire bad. Tree pretty.

Posts: 3436
Location: Ohio
Joined: Nov 22nd, 2002
Re: Limiting automatic lookup
Reply #4 - May 5th, 2004 at 8:19pm
Print Post Print Post  
If you want it to be "on demand", you can put a command button next to the text box and do the lookup when the button is clicked. Would that work for you?
  

- Hammer
The plural of anecdote is not data.
Back to top
IP Logged
 
JohhnyB
Member
*
Offline


No personal text

Posts: 23
Joined: Apr 28th, 2004
Re: Limiting automatic lookup
Reply #5 - May 6th, 2004 at 5:55pm
Print Post Print Post  
I believe that is what i am getting at.   a Command button"  as oppsed to a radio button?  the command button does a little   ^.  right.  yes like the calendar example in the January 2004  edition of INside Sesame.

i have to do it for each element.  on the as/400  i could program an F4 and it would respond to the right lookup depending on what field the cursor was in.  But, close enough.
  
Back to top
 
IP Logged
 
Hammer
YaBB Administrator
Lanticans
*****
Offline


Fire bad. Tree pretty.

Posts: 3436
Location: Ohio
Joined: Nov 22nd, 2002
Re: Limiting automatic lookup
Reply #6 - May 6th, 2004 at 6:09pm
Print Post Print Post  
The Command Button will do whatever you tell it to do in programming. A command button is a rectangular element which appears as a button which can be clicked.

A radio button is a round element which can be turned on or off. Radio Buttons appear in groups. If any one radio button in the group is turned on, the rest are automatically turned off. This allows for an exclusive choice to be made.
  

- Hammer
The plural of anecdote is not data.
Back to top
IP Logged
 
JohhnyB
Member
*
Offline


No personal text

Posts: 23
Joined: Apr 28th, 2004
Re: Limiting automatic lookup
Reply #7 - May 7th, 2004 at 11:28am
Print Post Print Post  
ok thanks.  next question,   i am actually doing a @userslect of a file.   say, for instance,  I am looking up a field to get a customer number.  i want to start that select at the letter "H".  Can i put "H" in the element field and then somehow start my userselect with the "H"?    What I have been able to do so for was get the entire file.  Not that useful when the file is 1000 records.
  
Back to top
 
IP Logged
 
TJCajun
Junior Member
**
Offline


"Laissez les bons temps
rouler"

Posts: 72
Location: Louisiana
Joined: Nov 25th, 2002
Re: Limiting automatic lookup
Reply #8 - May 7th, 2004 at 1:03pm
Print Post Print Post  
The May 2004 issue of Inside Sesame,    http://www.insidesesame.com ; ,  has the first part of a 2-part article about creating a "contacts" application.  In the May issue, there's something that may be just what you need.  It shows how programming brings up a "pick-list" of the alphabet, and then when the user clicks on a specific letter, (say for instance  "M"), then all the contacts whose company (or last name) start with "M" pop up for the user to pick from.  Programming is there for you to look at, and you can copy/paste.  If you do this, be sure to read on the web site what you must do to modify this so it will run properly in Sesame.  There's a section telling you what to do.

The application will be provided with the second part of the article in June, so you can get it as a download then.
  
Back to top
IP Logged
 
Hammer
YaBB Administrator
Lanticans
*****
Offline


Fire bad. Tree pretty.

Posts: 3436
Location: Ohio
Joined: Nov 22nd, 2002
Re: Limiting automatic lookup
Reply #9 - May 7th, 2004 at 1:47pm
Print Post Print Post  
Quote:
ok thanks.  next question,   i am actually doing a @userslect of a file.   say, for instance,  I am looking up a field to get a customer number.  i want to start that select at the letter "H".  Can i put "H" in the element field and then somehow start my userselect with the "H"?    What I have been able to do so for was get the entire file.  Not that useful when the file is 1000 records. 


The routines you want are XUserSelectR and @XUserSelectR.
Code
Select All
MyVar = @xuserselectr(@FN, "Company Name", "Company Name", "H", "Hzzzzzzzzz")  



See the Programming Guide for full detail on these routines.
  

- Hammer
The plural of anecdote is not data.
Back to top
IP Logged
 
JohhnyB
Member
*
Offline


No personal text

Posts: 23
Joined: Apr 28th, 2004
Re: Limiting automatic lookup
Reply #10 - May 7th, 2004 at 2:55pm
Print Post Print Post  
thanks again.   my first time through the manual i didn't pickup on the distinction between the various techinques .  making progress.
  
Back to top
 
IP Logged
 
JohhnyB
Member
*
Offline


No personal text

Posts: 23
Joined: Apr 28th, 2004
Re: Limiting automatic lookup
Reply #11 - May 7th, 2004 at 2:57pm
Print Post Print Post  
how do i get the letter 'H'  from the imput field to be the variable?   looks like your code is hard coded with an "H"?  next time i use the select, it might be the letter "W"  or "CH" or "FL"?  can you make the field contents a variable and then do the select with the named variable?
  
Back to top
 
IP Logged
 
Hammer
YaBB Administrator
Lanticans
*****
Offline


Fire bad. Tree pretty.

Posts: 3436
Location: Ohio
Joined: Nov 22nd, 2002
Re: Limiting automatic lookup
Reply #12 - May 7th, 2004 at 3:02pm
Print Post Print Post  
Quote:
how do i get the letter 'H'  from the imput field to be the variable?   looks like your code is hard coded with an "H"?  next time i use the select, it might be the letter "W"  or "CH" or "FL"?  can you make the field contents a variable and then do the select with the named variable?   


If your element or variable name is MyFilter...
Code
Select All
MyVar = @xuserselectr(@FN, "Company Name", "Company Name", MyFilter, MyFilter + "zzzzzzzzz") 

  

- Hammer
The plural of anecdote is not data.
Back to top
IP Logged
 
JohhnyB
Member
*
Offline


No personal text

Posts: 23
Joined: Apr 28th, 2004
Re: Limiting automatic lookup
Reply #13 - May 7th, 2004 at 4:50pm
Print Post Print Post  
ok,  i am sure i have enough info   to figure this out.  i have been doing accounting issues for the last week.  maybe next week i can put my sesame hat back on and use all this great advice.   keep us informed on the seminar.  i will push hard to get to go.
  
Back to top
 
IP Logged