Page Index Toggle Pages: [1] 2 3 ... 5 Send Topic Send Topic Print Print
Very Hot Topic (More than 25 Replies) UserSelect Question (Read 12528 times)
FlipGilbert
Full Member
***
Offline


Running Ver 2.6.4

Posts: 236
Location: Sandy Eggo
Joined: Mar 8th, 2005
UserSelect Question
Mar 18th, 2005 at 9:16pm
Print Post Print Post  
Im looking to add a XUserSlect to a layout  "dispatch" looking up the customers name from the "customer" layout. my question is my customer select field is HUGE, is there a way to type the first few letters of the customers name in the primary field to reduce the size of the user select field?


I kinda feel like the boy who found a genie in a bottle, Im afraid to waste any of my three wishes on stupid questions.
  

It's not what a man says that matters or how he says it, but what he does and how he does it.
Back to top
 
IP Logged
 
Ray the Reaper
Global Moderator
Members
Lantica Support
*****
Offline


The One & The Only

Posts: 2480
Joined: Aug 20th, 2003
Re: UserSelect Question
Reply #1 - Mar 18th, 2005 at 9:25pm
Print Post Print Post  
Hello,

Here is an example that should be able to get you started in the right direction.

http://www.lantica.com/Forum2/cgi-bin/yabb/YaBB.pl?board=program;action=display;...

-Ray
  

Raymond Yoxall Consulting
ray.yoxall@gmail.com
ryoxall@lantica.com
Sesame Applications, Design and Support
Back to top
IP Logged
 
Bharat_Naik
Senior Member
Members
*****
Offline


Ever ready to learn and
share

Posts: 1202
Location: Chicago,  Illinois
Joined: Dec 16th, 2003
Re: UserSelect Question
Reply #2 - Mar 18th, 2005 at 9:27pm
Print Post Print Post  
Yes, it can be done easily using xuserselectr function. There was quite a discussion about it on this forum. I will look up the thread and post it here. I use this all quite extensively.
  
Back to top
 
IP Logged
 
Bharat_Naik
Senior Member
Members
*****
Offline


Ever ready to learn and
share

Posts: 1202
Location: Chicago,  Illinois
Joined: Dec 16th, 2003
Re: UserSelect Question
Reply #3 - Mar 18th, 2005 at 10:04pm
Print Post Print Post  
It is discussed in following thread.

http://www.lantica.com/Forum2/cgi-bin/yabb/YaBB.pl?board=archived;action=display...

http://www.lantica.com/Forum2/cgi-bin/yabb/YaBB.pl?board=archived;action=display...

As Ray pointed out,  the function provided by Erika that is also placed in the programming example section is used for this function. By using that function we can use the most common search carteria that is being used in Sesame and Q&A.

Use of above function with @xuserselectr

John..  will give you the list of items starting with John
..John.. will give you list of items with "John" somewhere 
..John  will give you list of items ending with "John"
  
Back to top
 
IP Logged
 
FlipGilbert
Full Member
***
Offline


Running Ver 2.6.4

Posts: 236
Location: Sandy Eggo
Joined: Mar 8th, 2005
Re: UserSelect Question
Reply #4 - Mar 20th, 2005 at 4:50am
Print Post Print Post  
I think this is WAY over my head at the present time. thank you for the direction.
  

It's not what a man says that matters or how he says it, but what he does and how he does it.
Back to top
 
IP Logged
 
FlipGilbert
Full Member
***
Offline


Running Ver 2.6.4

Posts: 236
Location: Sandy Eggo
Joined: Mar 8th, 2005
Re: UserSelect Question
Reply #5 - Mar 20th, 2005 at 10:20pm
Print Post Print Post  
After reading this post over and over, heres what I have
oName is the element on the order form vName is the element on the Vendors form
I have this in element (on exit)

if @in(oName, "..") > 0 then 

{
  vFieldName = oName
  picklist_choose ( )
   
  oName = @xUserselectR ("newdispatch.db”, "Vendors!Vname", "VName", vStart, vEnd)

}

and this in global code

stat vFieldName as String
stat vStart as String
stat vEnd as String

Subroutine PickList_choose( )

vStart = @left (vFieldName, @in (vFieldName, "..") - 1) + @chr (1)
vEnd = @left (vFieldName,   @in (vFieldName, "..") - 1) + "zzzzzzz"
End Subroutine

When tabbed or entered it does nothing…..
Where did I mess up, I checked spelling also
  

It's not what a man says that matters or how he says it, but what he does and how he does it.
Back to top
 
IP Logged
 
Bharat_Naik
Senior Member
Members
*****
Offline


Ever ready to learn and
share

Posts: 1202
Location: Chicago,  Illinois
Joined: Dec 16th, 2003
Re: UserSelect Question
Reply #6 - Mar 20th, 2005 at 10:35pm
Print Post Print Post  
Probably you already know that x-family of commands and functions cannot be tested in the Preview mode. You are better of saving your application appended by test or reconciling it first. I prefer the first method. If it is Customer.dsr, I save the application as Customertest.db.  When everything works as you want, you may reconcile it to customer.db

See if this helps.
  
Back to top
 
IP Logged
 
FlipGilbert
Full Member
***
Offline


Running Ver 2.6.4

Posts: 236
Location: Sandy Eggo
Joined: Mar 8th, 2005
Re: UserSelect Question
Reply #7 - Mar 21st, 2005 at 12:17am
Print Post Print Post  
yep, that thing about the x family not working in preview  had my head on fire last week. I have come a long way with the help of this forum. I have tested it in  a reconsiled file.
  

It's not what a man says that matters or how he says it, but what he does and how he does it.
Back to top
 
IP Logged
 
FlipGilbert
Full Member
***
Offline


Running Ver 2.6.4

Posts: 236
Location: Sandy Eggo
Joined: Mar 8th, 2005
Re: UserSelect Question
Reply #8 - Mar 21st, 2005 at 12:27am
Print Post Print Post  
oh my it works!!! I been working on it to long, I was forgeting to put the dot dot on the end of it! your good! thank you so very much for the help!
  

It's not what a man says that matters or how he says it, but what he does and how he does it.
Back to top
 
IP Logged
 
Bharat_Naik
Senior Member
Members
*****
Offline


Ever ready to learn and
share

Posts: 1202
Location: Chicago,  Illinois
Joined: Dec 16th, 2003
Re: UserSelect Question
Reply #9 - Mar 21st, 2005 at 5:55pm
Print Post Print Post  
".." is not just for what to search but also when to search. I usually use this for find out the code. When you already know the code, you don't have have to have the list, select the item from the list and waste time. I have also found it useful to make one display element in external database from where you are looking up the value and produce the display of information in the the list as I wish to see it. Moreover this will help to deal with the "/" character that is not that user friendly as it serves as menu like function.
  
Back to top
 
IP Logged
 
FlipGilbert
Full Member
***
Offline


Running Ver 2.6.4

Posts: 236
Location: Sandy Eggo
Joined: Mar 8th, 2005
Re: UserSelect Question
Reply #10 - Mar 21st, 2005 at 6:10pm
Print Post Print Post  
I found that out about if you know the code it doesnt waste time on the pick list. Only thing is when I type " ..abc.." it pulls up the whole list "abc.." works nice and "..abc" seems to work. but im not complaining, im too happy about getting past this first hurdle. thanks for the time and all the help!
  

It's not what a man says that matters or how he says it, but what he does and how he does it.
Back to top
 
IP Logged
 
Bharat_Naik
Senior Member
Members
*****
Offline


Ever ready to learn and
share

Posts: 1202
Location: Chicago,  Illinois
Joined: Dec 16th, 2003
Re: UserSelect Question
Reply #11 - Mar 21st, 2005 at 6:54pm
Print Post Print Post  
..abc..should pull out only the list which containg "abc" string somewhere in the item.  Have you used the function that Erika provided and place it in the Global Code before placing the subroutine pick list () ?
  
Back to top
 
IP Logged
 
FlipGilbert
Full Member
***
Offline


Running Ver 2.6.4

Posts: 236
Location: Sandy Eggo
Joined: Mar 8th, 2005
Re: UserSelect Question
Reply #12 - Mar 21st, 2005 at 7:45pm
Print Post Print Post  
no, i did not. and when I did (put it in global) it made an error on evevry xlookup and all other functions in program. strange
  

It's not what a man says that matters or how he says it, but what he does and how he does it.
Back to top
 
IP Logged
 
Bharat_Naik
Senior Member
Members
*****
Offline


Ever ready to learn and
share

Posts: 1202
Location: Chicago,  Illinois
Joined: Dec 16th, 2003
Re: UserSelect Question
Reply #13 - Mar 21st, 2005 at 8:02pm
Print Post Print Post  
Give me little time, I will place here the code I am using.
  
Back to top
 
IP Logged
 
Bharat_Naik
Senior Member
Members
*****
Offline


Ever ready to learn and
share

Posts: 1202
Location: Chicago,  Illinois
Joined: Dec 16th, 2003
Re: UserSelect Question
Reply #14 - Mar 21st, 2005 at 8:42pm
Print Post Print Post  
I have implemented abc..  and ..abc..
I do not see any value of ..abc if both above are working.

Global Code
______________

var vFieldName as String
var vStart as String
var vEnd as String


// Finds all values in vVals that contain vMatch. Returns matching
// values as a semicolon separated list.
Function FilterValueList(var vVals as String, vMatch as String) as String
var vList as String
var vItem as String

vList = ""
While @Len(vVals) > 0
{
  vItem = Split(vVals, ";")
  If @Instr(vItem, vMatch) > 0
  {
   If @Len(vList) > 0 
   {
    vList = vList + ";"
   }
   vList = vList + vItem
  }
}
return(vList)
End Function


var vApplication as String
var vTarget as String
var vDisplay as string

//For PickList

Subroutine PickList_choose( )
var vVals as String
var vFinalList as String
var vSearch as String

If @Right (vfieldName, 2) = ".." and @Left (vFieldName, 2) <> ".." then
     {
     
           vStart = @left (vFieldName, @in (vFieldName, "..") - 1) + @chr (1)
           vEnd = @left (vFieldName,   @in (vFieldName, "..") - 1) + "zzzzzzz"

     }

If @left (@(vFieldName), 2) = ".." and @Right (@(vFieldName), 2) = ".." then
     {
           vSearch = @replace (@(vFieldName), "..", "")
           vFinalList = ""
           vVals = @XListValues(vApplication, vDisplay) 
           vFinalList = FilterValueList(vVals, vSearch)
           @(vFieldName) = @UserSelect(vFinalList)
        
         If @in (@(vFieldName), "/") > 0 then
           @(vFieldName) = @Replace (@(vFieldName), "/", "//")
           //writeln (@(vFieldName))                  
           
           @(vFieldName) = @xlookup (vApplication, @(vFieldName), "Display1", vTarget)

     }

End Subroutine

======================

Dx1  on element exit event    (Dx1 is the name of element)
____________

If @left (Dx1, 2) = ".." and @right (Dx1, 2) = ".." then

     {
           vApplication = "data\diag.db"
           vTarget = "DiagCode"
           vDisplay = "Diag!Display1"
           vFieldName = "Dx1"
           picklist_choose ( )
           
     }

if @Right (Dx1, 2) = ".." and @Left (Dx1, 2) <> ".." then

     {
           vFieldName = Dx1
           picklist_choose ( )
           
           Dx1 = @xUserselectR ("data\Diag.db", "Diag!Display", "DiagCode", vStart, vEnd)
     }
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: [1] 2 3 ... 5
Send Topic Send Topic Print Print