Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

This topic is 7844 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Posted

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

Posted

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

Posted

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

Posted

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.

Posted

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

Posted

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.

Posted

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.

Posted

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.

Posted

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" ?

Posted

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.

Posted

Hi Tom, neither did I ? wink.gif

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.

This topic is 7844 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.