December 21, 200520 yr 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!!
December 21, 200520 yr Hi Lindsay, Unfortunately, you will have to clear out each field individually.
December 21, 200520 yr 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
December 21, 200520 yr 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
December 21, 200520 yr Author 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!
December 21, 200520 yr Go ahead and create the records in a table when you are done on exit just delete all records of that table.
December 21, 200520 yr ..... 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, 200520 yr by Guest
December 22, 200520 yr 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
December 22, 200520 yr 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, 200520 yr by Guest
December 22, 200520 yr 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
December 22, 200520 yr 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.
December 22, 200520 yr 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:
December 22, 200520 yr " 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, 200520 yr by Guest Added Update
December 22, 200520 yr 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.
December 22, 200520 yr The way I understand it, the layout is being used as a glorified typewriter. :iagree:
Create an account or sign in to comment