lindsay Posted December 21, 2005 Posted December 21, 2005 Hello, I have a layout with many fields and I was wondering if there was a command in the scriptmaker that would clear them all at once, instead of having to choose clear in the scriptmaker for each individual field... Thanks for any help!!
mr_vodka Posted December 21, 2005 Posted December 21, 2005 Hi Lindsay, Unfortunately, you will have to clear out each field individually.
Raybaudi Posted December 21, 2005 Posted December 21, 2005 Yes, there is a simple manner... Go to field(FirstFieldOfYourLayout) set field (aGlobalOne; Get(ActiveFieldName) Loop clear go to next field exit loop if(Get(ActiveFieldName) = aGlobalOne) End Loop
LaRetta Posted December 21, 2005 Posted December 21, 2005 Hi Lindsay, But why clear all fields? Why not create a new record? Clearing all fields to re-enter data means that the record won't reflect the correct 'date created' nor correct Creator name (if you use those auto-enter features). Can you explain a bit more of your process? LaRetta
lindsay Posted December 21, 2005 Author Posted December 21, 2005 Hello all, thank you for your help! I did not want to create a new record everytime because the way I understand it, (or atleast have it set up) when I create a new record, it saves it, and I start building a database of records. The information I am inputting into this particular layout only needs to be printed once and then can be deleted forever. No need to keep a record of it! ( also, I don't use either of those auto features!) Is there a way to create a new record without it automatically saving the old ones? Thanks for your help!
Ocean West Posted December 21, 2005 Posted December 21, 2005 Go ahead and create the records in a table when you are done on exit just delete all records of that table.
Lee Smith Posted December 21, 2005 Posted December 21, 2005 (edited) ..... The information I am inputting into this particular layout only needs to be printed once and then can be deleted forever. ..... Interesting approach. Is this data that you are only keeping for a print, being imported as part of other data that is being kept? If not, and it isn't needed for any other purpose, why are you putting it in there in the first place? Lee Edited December 21, 2005 by Guest
Søren Dyhr Posted December 22, 2005 Posted December 22, 2005 Despite a record containing an exorbitant number of fields to clear, points in direction of a lesser normalized datastructure, could you however make one single field trigger for the rests behavior. What if all relevant field gets following autoenter (replaces...) attached to thier defs.: Evaluate(Case(0;0);triggerField) ...which is easier to write than: Evaluate ( "GetAsText ("")" ; triggerField ) --sd
LaRetta Posted December 22, 2005 Posted December 22, 2005 (edited) Good idea, Soren! But Evaluate() isn't needed, I don't think ... On textField: If ( not IsEmpty ( trigger ) ; textField ) All fields with this Auto-Enter (Replace) will clear as long as the field referenced (itself) is within the same table as trigger. UPDATE: Also - can't the trigger be (should be) a global (within same table)? Ahh, comes right back to Comment's discussions of late. Powerful stuff... Edited December 22, 2005 by Guest
comment Posted December 22, 2005 Posted December 22, 2005 So, changing "many fields" to auto-enter is more efficient than repeating the Clear Field script step as many times? How about a simple: Go to Layout [ manyFields ] Show All Records Delete All Records New Record/Request
Raybaudi Posted December 22, 2005 Posted December 22, 2005 But, if those records contain fields that I didn't want to delete ? lindsay said that she wished to delete only the fields of that layout ! I still think that repeating the Clear Field script step is the best way.
LaRetta Posted December 22, 2005 Posted December 22, 2005 Point taken, Michael and my original suggestion also. I was just saying that Evaluate() wasn't needed specifically, if that was an option being considered. Agreed, create the record, enter the data, delete the record. :wink2:
LaRetta Posted December 22, 2005 Posted December 22, 2005 (edited) " still think that repeating the Clear Field script step is the best way. " Depends upon how important it is. If it's critical that it be right, I'd rather use an Auto-Enter (Replace). Scripts can trash partway through. UPDATE: And if only some fields should be cleared, why not use globals for those fields instead? Obviously they wouldn't contain data you'd wish to hang on to. UPDATE: I, as Soren, question the process here. If there are that many fields to set and clear, something is amiss... Edited December 22, 2005 by Guest Added Update
comment Posted December 22, 2005 Posted December 22, 2005 The way I understand it, the layout is being used as a glorified typewriter. If the layout belongs to a table that is also used for something else, then that's not good.
Raybaudi Posted December 22, 2005 Posted December 22, 2005 The way I understand it, the layout is being used as a glorified typewriter. :iagree:
Recommended Posts
This topic is 6914 days old. Please don't post here. Open a new topic instead.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now