Is it possible programmatically to change a Field’s formula?
I have a procedure to add a field to a database, and I would like that new field to be added to the formula in an existing field. If the answer is yes, I will be utterly amazed and happy.
Is it possible programmatically to change a Field’s formula?
I have a procedure to add a field to a database, and I would like that new field to be added to the formula in an existing field. If the answer is yes, I will be utterly amazed and happy.
You can do it using the setfieldproperties
statement. Here is what I used to set the formula of a test field named A to '//OK"
setfieldproperties "A",initializedictionary(
"FORMULA","//OK")
Thanks. Just what I was hoping would be available.
So now you are “utterly amazed and happy” right?
FYI, a good way to find out how to do things like this is to look at the blueprint. In fact, you could use Show Field Blueprint, copy out the entire blueprint, then delete all of the stuff you don’t need, in this case leaving you with just the code for setting the formula.
Yes, I am. It happens frequently when I learn something new with PanX.