www.Inmagic.com    Inmagic Forums    Inmagic Forums  Hop To Forum Categories  Scripting    Using a script to update a value in a particular record within a recordset
Go
New
Find
Notify
Tools
Reply
  
-star Rating Rate It!  Login/Join 
Posted
Hi all,

I have the following script that clears the contents of a particular field for all records in the current recordset (in this case I am clearing fines owed, and the button being clicked is on a report window which displays and totals these fines):

function clearfines_onClick()
{
var crs = Application.activeTextbase.currentRecordset;
var updatedCt = 0;
if ((crs != null) && (crs.RecordCount > 0))
{
crs.MoveFirst();
while (crs.EOF == false)
{
crs.Fields("Temp Fines").Value = "";
crs.Update();
crs.MoveNext();
}
}
Command.displayReport();
}

This is working fine. Now I'd like to also have a button that appears on each individual record in the report that will perform the same function for just that one record. I figure it should be essentially the same as above, except instead of running through a loop of all the records, it should just go straight to the one in question and make the change.

Is there any way of writing a script that will move to the record that has already been selected by the user (i.e. they clicked on it on the report window screen)?
 
Posts: 7 | Registered: Thu November 09 2006Reply With QuoteEdit or Delete MessageReport This Post
 Previous Topic | Next Topic powered by eve community  
 

www.Inmagic.com    Inmagic Forums    Inmagic Forums  Hop To Forum Categories  Scripting    Using a script to update a value in a particular record within a recordset