June 5, 200322 yr I have a field in a record (a "customer complaint handling form")that is in the second layout and must contain a value before the record can) be closed(or Archived) but this field might not be entered for months before closing (Archiving) the record. I need a script that will allow filemaker pro 6 to close without this field having a value, but the record (customer complaint form) cannot be closed (Archived) until this field contains a value. Is this possible and if so can someone give me an example script. Thank you for any help. Josh
June 5, 200322 yr I assume that you have some sort of script in place for the "Archive" or "Close Complaint" process. Add a few lines to the top of that script: If (IsEmpty(YourField)) .. Go to layout (Wherethefieldis) .. Go to field(YourField) .. Show message ("Can't proceed until you blah blah") .. Halt script End If
June 5, 200322 yr Author Thanks Fitch Ill try this. Thanks again I will post back with the results. Josh
June 5, 200322 yr Author This works perfectly. What could I add and where do I add a subscript or step in this script that will allow me to do this with more than one "forced entry before archiving" field. (4 to be exact) Thanks, Josh
June 5, 200322 yr Just click the first line of the above script, then shift-click the last line, then click the Duplicate button 3 times. Then go back and change the field references, and the message if need be, and you're all done.
June 5, 200322 yr Author I figured it out. If (IsEmpty(YourField_1)) If (IsEmpty(YourField_2)) If (IsEmpty(YourField_3)) If (IsEmpty(YourField_4)) .. Go to layout (Wherethefieldis) .. Go to field(YourField) .. Show message ("Can't proceed until you blah blah") .. Halt script End If Thank you once again Fitch, Much appreciated. Josh
June 5, 200322 yr Author If (IsEmpty(YourField_1)) or If (IsEmpty(YourField_2)) or If (IsEmpty(YourField_3)) or If (IsEmpty(YourField_4)) .. Go to layout (Wherethefieldis) .. Go to field(YourField) .. Show message ("Can't proceed until you blah blah") .. Halt script End If Sorry about that, I needed to have the "or" there for it to work.
June 5, 200322 yr No, that's not what I meant. The way you've done it, you always go to the same field, even if it's not the one that's empty. I like to minimize users' confusion, so even if it makes the script a little longer -- but actually easier to follow the logic, I think -- I would test for each field separately: If (IsEmpty(YourField_1)) .. Go to layout (Wherethefieldis) .. Go to field(YourField_1) .. Show message ("YourField_1 cannot be left blank.") .. Halt script End If # If (IsEmpty(YourField_2)) .. Go to layout (Wherethefieldis) .. Go to field(YourField_2) .. Show message ("Please do something about YourField_2") .. Halt script End If # etc.
June 5, 200322 yr Well, or doesn't exist in ScriptMaker. It's a calculation syntax. If (Is Empty(field1) or Is Empty(field2)....) Besides, as this could be useful, you could also have this condition as a plain calculated field c_checkAllFieldsEmpty returning 1,0. Then the script would simply be If (c_checkAllFieldsEmpty=1) The rest of your script.
June 5, 200322 yr Yep Tom. You're leading the user to the empty field.... Just one question. Why is the Show Message step coming after the go to field. Would it always be selected after you leave the message box with "OK" ?
June 6, 200322 yr Ugo, you expect me to actually TEST these things? It should work either way, so it's more of an aesthetic choice. Note that I not only lead the user to the appropriate field, but each field can have its own message as well. And as I said, the script is longer, but simpler.
June 6, 200322 yr Hi Tom, neither did I ? Sure a long good script is better than a short bad script.... I just answered Josh assuming the condition was "4 fields empty", then go to another field. I should have read from the begining of the post.
Create an account or sign in to comment