GetAsText ( “” )

Ahh, yes. No wonder I don't use Clear! The ability to use Set Field without having to have the field present on a layout is a huge plus.

2 Likes

In the old days, to get a null value I used to define a global field but never enter anything into it. Referring to it gave me a null.

4 Likes

Clever idea!

I was reading through this string wondering if/when someone was going to mention the Clear function.. Personally, I never use it. I've never seen the point when SetFeild="" works so well. I think steve_ssh brought up a great point with the field being required on the layout for the Clear function to work. I always wondered if I might be missing something here but after reading through all of these comments I think I will stick to the old fashioned SetField method...

I do have a couple of notes to make about using Replace Field Contents.. This function does not require a calculation such as GetAsText( "" ), you could just use "" and that would work just the same and would probably be even faster since it doesn't have to calculate anything. The other thing I always point out is that using Replace Field Contents on any field that is not a Global field will result in the modification timestamp and modified by fields to get updated thus making it difficult to audit who edited the record last. I always try to avoid that if possible. Also, it can be a dangerous function if any mistake is made with creating the found set.... just some thoughts.

3 Likes

This is an important consideration for anyone who wants to be able to rely on the metadata associated with any data set. Thanks for raising it @KyleWilliams.

The safe alternative is to generate the data needed for the replacement in a file and import it. Imports can be performed without triggering updates.

2 Likes

I think of Replace Field Contents as a sledgehammer—it smashes all available records with a single blow. It should only be used when you know that this effect is exactly what currently need.

3 Likes