You could use an On Object Modify triggered script on Agnecy Name that clears it if the Customer Type is not "Agency".
And you can use an OnObjectEnter script trigger with the Agency Name field to prohibit entry into the Agency Name field if the Radio button field does not have "agency" selected.
Thank you both for this. I thought I needed an OnObjectModify, so I went into Agency field and had got as far as this:
But I haven't used scripts before (I am building a database but I am not a programmer), so the thing is, I have no idea what to do next. None of the available formulae on the left hand column seemed to fit. Does one write 'freehand'? I just don't know. I understand the principle of what I have to do, but it is the actual script writing that I need help with. It's probably really easy obvious stuff, but if you could tell me how to actually write the specific script for this required action, that would be fantastic.
Thanks so much in advance.
You build your script by double clicking listed script steps and then clicking the various buttons that pop up in order to specify the correct options for each step you add to your script.
If[Customer::CustomerType ≠ "Agency"]
Set Field [Customer::Agency Name; ""]
will clear the agency name field.
When Setting up Set Field, there are two Specify buttons that must be clicked. To get Set Field [Table::Field ; Expression], add set field to your script and click the first button (specify target field). Select Table::Field from the list of fields. Do not click the specify button next to the repetition box. Click OK to close this dialog box. Now click the lower specify button (calculated result) and create the expression to the right of the semicolon (;). Do not try to type in the semicolon.
PhilModJunk, thank you for your forbearance, you must be sighing out loud over this one :)
I have got as far as adding set field to my script and specifying the target field. I have clicked OK to close the dialog box. I have clicked on the lower specify button but there is no ;Expression. How/when is that generated please? And is expression the answer? Or do I then have to modify expression?
Sorry for being so hopeless.
"expression" in your case is the pair of empty quotes after the semi-colon.
I do suggest you look for and get some training materials on fileMaker that includes lessons on scripting. Creating solutions in FileMaker without being able to create scripts is like rowing a boat with only one oar...
Thank you PhilModJunk, you are really kind. I will have a play with that.
You are absolutely right about the scripting training materials. I have done the basic video training so I know what scripts do, where to find them, when you can use them, all of that, but other than the very specific examples used in the training, I can't actually write the darned things.
Best wishes, Tania