Normal Topic Record De-selection (Read 1355 times)
NHUser
Full Member
***
Offline



Posts: 320
Location: Amherst, NH
Joined: Aug 2nd, 2010
Record De-selection
Mar 28th, 2013 at 12:53pm
Print Post Print Post  
My application has a file full of product specific work instructions.  Each work instruction is specific to a customer part number, so one customer may have many records in my file.

If I set my retrieve spec to the customer name, I will get all the work instruction records for that customer.  There are times that I want to close one or more of the records of that group in order to run a Mass Update on only certain of the records.

Is there a way to "close" a record while leaving the remaining records open?
  
Back to top
 
IP Logged
 
lksseven
Full Member
***
Offline



Posts: 416
Location: Southwest
Joined: Jan 26th, 2009
Re: Record De-selection
Reply #1 - Mar 28th, 2013 at 2:16pm
Print Post Print Post  
NHuser,

Once you have gotten your result set (retrieve customer name "Smith") ... In the 'Results Menu Section" of the Commands Menu on the left side of your Sesame application, the first menu option is 'Remove Record from Results' .  This button will remove the current record from your results set, but won't delete the record from your database.
  

Larry
Back to top
IP Logged
 
BOBSCOTT
Senior Member
Members
*****
Offline


That Darn Computer #$X#
{curse words}

Posts: 1195
Joined: Nov 22nd, 2002
Re: Record De-selection
Reply #2 - Mar 28th, 2013 at 4:24pm
Print Post Print Post  
To add to lksseven  suggestion,

you can also use the sbasic command RemoveRecordFromResultset() on a command button on your form.

  

Team – Together Everyone Achieves More
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: Record De-selection
Reply #3 - Mar 28th, 2013 at 5:18pm
Print Post Print Post  
Depending upon how often do you use this command and whether you hide the command tree or not in the ordinary circumstances, command button could be very handy to remove the current record. You can also use @SelectTreeItem( ) sbasic command for this purpose.
  
Back to top
 
IP Logged
 
lksseven
Full Member
***
Offline



Posts: 416
Location: Southwest
Joined: Jan 26th, 2009
Re: Record De-selection
Reply #4 - Mar 31st, 2013 at 2:16am
Print Post Print Post  
Bob,

"... RemoveRecordFromResultset() on a command button on your form"

I like your suggestion better!   A command button is the more versatile solution.
  

Larry
Back to top
IP Logged
 
NHUser
Full Member
***
Offline



Posts: 320
Location: Amherst, NH
Joined: Aug 2nd, 2010
Re: Record De-selection
Reply #5 - Apr 1st, 2013 at 2:34pm
Print Post Print Post  
Thanks!  This is just what I needed.
  
Back to top
 
IP Logged
 
NHUser
Full Member
***
Offline



Posts: 320
Location: Amherst, NH
Joined: Aug 2nd, 2010
Re: Record De-selection
Reply #6 - Apr 1st, 2013 at 3:05pm
Print Post Print Post  
Hey, I've just been playing with the command:

     RemoveRecordFromResultset()

It works as expected except if I'm in the last record in the set.  When I invoke this command in the last record in the set, it leaves behind a blank record.  Can this be avoided?


  
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: Record De-selection
Reply #7 - Apr 1st, 2013 at 8:27pm
Print Post Print Post  
Use the following code and hopefully that would take care of it.

Code
Select All
var vtotal as Int

		RemoveRecordFromResultSet()
		vtotal = @ResultSetTotal()
		If @ResultSetCurrentPosition ( )  > vTotal then
			{
				ResultSetCurrentPosition (vTotal)
			}
 

  
Back to top
 
IP Logged
 
NHUser
Full Member
***
Offline



Posts: 320
Location: Amherst, NH
Joined: Aug 2nd, 2010
Re: Record De-selection
Reply #8 - Apr 2nd, 2013 at 9:23pm
Print Post Print Post  
Thanks Bharat_Naik!!

That programming works great!
  
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: Record De-selection
Reply #9 - Apr 11th, 2013 at 5:11pm
Print Post Print Post  
NHUSER, I would put following code on form Entry event, so that the command button (RemoveFromSet ) will only show up when it is needed. It would not show up in @Add or @search mode and it would not even be there when there is only one record.

Code
Select All
If @Mode ( ) = 1 and @ResultSetTotal ( )  > 1 then
	{
		Visibility (RemoveFromSet, 1)

	}
	Else
	{
		Visibility (RemoveFromSet, 0)

	}
 

  
Back to top
 
IP Logged