Normal Topic @SelectTreeItem Confusion (Read 814 times)
BOBSCOTT
Senior Member
Members
*****
Offline


That Darn Computer #$X#
{curse words}

Posts: 1195
Joined: Nov 22nd, 2002
@SelectTreeItem Confusion
Aug 10th, 2006 at 5:40am
Print Post Print Post  
Why does this code on a command button ..

var vNav as Int

           
            vNav = @SelectTreeItem("Search Update Menu!Navigation!Advance Record (F10)")


Behave differently then following the same steps on the menu tree or pressing the F10 key?
  

Team – Together Everyone Achieves More
Back to top
 
IP Logged
 
Hammer
YaBB Administrator
Lanticans
*****
Offline


Fire bad. Tree pretty.

Posts: 3436
Location: Ohio
Joined: Nov 22nd, 2002
Re: @SelectTreeItem Confusion
Reply #1 - Aug 10th, 2006 at 12:34pm
Print Post Print Post  
What difference in behavior are you seeing?
  

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


That Darn Computer #$X#
{curse words}

Posts: 1195
Joined: Nov 22nd, 2002
Re: @SelectTreeItem Confusion
Reply #2 - Aug 10th, 2006 at 1:52pm
Print Post Print Post  
If I use the menu or the F10 function key  it commits the record and tries to advance to the next record and I believe is caught by my on form entry logic of:

If @Update and ord_ponum = ""  // If @Update and @Isblank(ord_ponum)

Then

     {
     @Msg("Returning you to previous record.")
     ResultSetCurrentPosition(@ResultSetCurrentPosition() - 1)
     }

With the command button logic shown in original post above it creates a new Record.
  

Team – Together Everyone Achieves More
Back to top
 
IP Logged
 
Hammer
YaBB Administrator
Lanticans
*****
Offline


Fire bad. Tree pretty.

Posts: 3436
Location: Ohio
Joined: Nov 22nd, 2002
Re: @SelectTreeItem Confusion
Reply #3 - Aug 10th, 2006 at 2:03pm
Print Post Print Post  
1. If you want to prevent an advance to the next record, use NotifyForm instead.

2. You are likely seeing this behavior because you are advancing from inside SBasic code. This can affect when the next chunk of code encountered is able to run and can cause changes in behavior. We'd have to see the entire environment to point at exactly what is happening in your case.

Regardless, use NotifyForm instead to prevent Extend Mode and the point should be moot.
  

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


That Darn Computer #$X#
{curse words}

Posts: 1195
Joined: Nov 22nd, 2002
Re: @SelectTreeItem Confusion
Reply #4 - Aug 10th, 2006 at 2:33pm
Print Post Print Post  
Thanks for the Info. As always you guys and gals are the best.  Smiley

I was not having a problem achieving my objective (Sbasic offers me so many tools that I did it another way) I was just confused why it behaved differently. For some reason I thought the Sbasic command @SelectTreeItem() was just the same as if I used the mouse to press the same key sequence. (I guess the magic behind the curtain still eludes me!)

Thanks again for the help.
  

Team – Together Everyone Achieves More
Back to top
 
IP Logged