Normal Topic Current record flag (Read 543 times)
obfusc88
Full Member
***
Offline


No personal text

Posts: 194
Joined: Dec 17th, 2005
Current record flag
Jul 3rd, 2007 at 2:30am
Print Post Print Post  
I jsut read the article in July Inside Sesame that talked about marking current record automatically but it did not solve my problem.  I have many records for an individual, each record has a unique employee ID, some other fields, and a Yes/No field for "Current Record".  Only one record should be YES in current record field for each person and one must always be YES.  The current record will not always be the lastest record.  I need to be able to make sure when a record is changed to YES that the prevous YES record is changed to NO.  Is there a way I can do a mass update to all other records for that individual changeing them to NO?  Or can I just change the single record with the YES without having to Mass Update all of them?  This should probably be activated on Element Change if value = YES.
  
Back to top
 
IP Logged
 
Bob_Hansen
Senior Member
Members
*****
Offline


WOW, They have the Internet
on computers now!

Posts: 1861
Location: Salem, NH
Joined: Nov 24th, 2002
Re: Current record flag
Reply #1 - Jul 3rd, 2007 at 3:32am
Print Post Print Post  
This can probably be done similar to your earlier question about retrieves from retreives.

Retrieve all the records for the individual.
Sort in Descending order on Current Record element.
Go to first record in the sorted retrieved records.
Use @FormFieldValue to change to NO.

-------------------
Suggestion above is untested.  I just realized that this must happen before the actual "Current Record" is saved or you may have 2 records with YES, that is what you are trying to avoid.  IF you trigger this on Immediate Change, I think this will work OK for you.


  



Bob Hansen
Sesame Database Manager Professional
Sensible Solutions Inc.
Salem, NH
603-898-8223
Skype ID = sensiblesolutions
Back to top
IP Logged
 
obfusc88
Full Member
***
Offline


No personal text

Posts: 194
Joined: Dec 17th, 2005
Re: Current record flag
Reply #2 - Jul 9th, 2007 at 5:45pm
Print Post Print Post  
i just got back from vacation and hope to be able to try this out sometime this week.  And yes it does look like same thing as my other question.  thank you for your help so far.
  
Back to top
 
IP Logged