Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

This topic is 6914 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Posted

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!!

Posted

Hi Lindsay,

Unfortunately, you will have to clear out each field individually.

Posted

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

Posted

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? :wink2:

LaRetta

Posted

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!

Posted

Go ahead and create the records in a table when you are done on exit just delete all records of that table.

Posted (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 by Guest
Posted

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

Posted (edited)

Good idea, Soren! :wink2:

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 by Guest
Posted

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

Posted

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.

Posted

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:

Posted (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 by Guest
Added Update
Posted

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.

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.