The file link that you posted is not valid. Can you please resend. Thanks
Fantastic stuff, Phil ! I got the point. Now if I want to push the envelope, I generate an html text in the cMessage and send it by email. Anyone has tried formatting emails ?
I finally got the hang on the Substitute. Works ! That said, I pull the values from fields in different tables at runtime, so the point is in which record the focus is at the time when the field calculation takes place. Does anyone of the following options work in FM Pro ?:
- Easier if I generate the substituted text and assign it to a local variable at runtime (however I didn't find Substitute or Replace) in the script steps,
- option 2 would be trigger the recalculation of the field only when the user tabs into the field (at that point in time the focus of the different related tables will be correct)
- Easier if I generate the substituted text and assign it to a local variable at runtime
You can use variable with FileMaker functions pretty much the same as though they are field names in most cases and this is definitely the case in FileMaker. If you want to use a variable to receive the results of a substitute function, use Set variable with the substitute function in the second parameter.
- option 2...
Not sure I picture the logic of that one accurately. OnRecordLoad could perform a script to do this when a record becomes the current record and this does not require clicking or tabbing into a field. OnObjectEnter would do exactly what you describe.
Frankly, I'm not sure I see the advantage to either of these approaches. If you use a "message" table to store the field values used in the substitute function and to generate the messages from the template table, you can keep a record of exactly what message was sent, to whom and exactly what was said.This can even be by an auto-entered calculation if you want the resulting text to be editable after the substitution function merges the data with the template text.