Jump to content

Mandatory field. How?


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

Recommended Posts

I have some fields in the same table:

FirstName

LastName

Status (A popup with two choices)

street

city

st

zip

etc

It is imperative/mandatory that the user be taken from the LastName field into the STATUS field.

I tried OnObjectSave & OnObjectExit script triggers attached to LastName with script that has a Go To FIELD [status] but if the user clicks from LastName into another field, (say street), nothing happens. (looks like a mouse click over rides a script?)

I am, again, probably making this more difficult than it should be.

Ideas?

Link to comment
Share on other sites

Thanks for the reply.

Yes, it would make sense under most circumstances. But, when someone transfers from other organization, for example, they are NOT a candidate. Or, when someone joins without transferring and they have gone through the 'candidate' qualification steps they would enter as a "Member". So, "Candidate" is not *always* the correct entry for new records.

I just need a method for FORCE the entry of the cursor into the field after LASTNAME. Once there, it is trapped and the user has to delete the record or choose from the MEMBER/CANDIDATE popup.

Link to comment
Share on other sites

First, you should validate the Status field as 'Not empty'. Then it doesn't matter so much when exactly they fill it.

As for the script, it would be best to trigger it OnObjectExit. Make sure your script ends with:

Exit Script [Result: 0]

Perhaps it would be even better to have a field for MembershipDate. Then status could become a calculation.

Link to comment
Share on other sites

ishot-517.jpg

The problem is that when the user exits the LastName field by clicking on, for example, the address field, the LastName-->OnObjectExit fires, the Go To FIELD puts the cursor in the STATUS field and when the script ends, I can't see the cursor anywhere and the STATUS POPUP doesn't fire.

Interesting is that if I change the STATUS POPUP to a DROPDOWN the script fires correctly and activates the DROP-DOWN showing the contents.

It seems that the problem is in getting the POPUP to activate with a GO TO FIELD.

(Note: in the attached script, Mem_Can is what I have been calling the STATUS field)

ishot-515.jpg

Link to comment
Share on other sites

I hope FM fixes it in their next 'update'.

I really can't use a Drop Down because it is possible to delete the contents of the field which is contrary to needing the field to be a 'mandatory' fill.

Thanks for the link...

Link to comment
Share on other sites

It is possible to delete the contents of a pop-up menu just as well. That's why it's important to have validation in addition to layout measures.

Thanks for the comment. But, it sounds like a circular problem: I can't put the cursor in the desired popup field (OK, I CAN put it in the field but it won't show and it will not invoke the popup... it 'looks' like it is NOT there), if I write a validation script and the notify the user I MUST rely on the user to 'click' into the popup. Doesn't it seem that FM should fix the problem on their end instead of making the developer invoke this kind of convoulated, complicated validation? (Just my HO)

Link to comment
Share on other sites

I am afraid I don't get your meaning. Field validation (not "validation script") works on the data level and if you want to ensure your data integrity, you should use it first and foremost.

After that is done, and if you want to save your user the annoyance of validation messages, you can employ some layout measures, such as script triggers. But these are merely cosmetics and you should not rely on them.

Link to comment
Share on other sites

I am afraid I don't get your meaning. Field validation (not "validation script") works on the data level and if you want to ensure your data integrity, you should use it first and foremost.

After that is done, and if you want to save your user the annoyance of validation messages, you can employ some layout measures, such as script triggers. But these are merely cosmetics and you should not rely on them.

I am trying NOT to use data validation so that I can avoid the confusing FM error messages. (confusing to the user). I suppose I could write an ONRECORD SAVE script that would 'demand' that the user make a field entry (into a field where I can put the cursor but where the cursor DOES NOT SHOW and the POP UP does NOT popup). But, wouldn't it be easier for the developer and the user for FM to just fix popup on the Mac so it works as on Windows? (Yes, I know it is supposedly an OSX issue but the bottom line it is "code" not magic.)

Link to comment
Share on other sites

Well, the point is that you SHOULD use data validation because that's your ultimate defense. You could also upgrade to v.11 where you can trigger a script OnObjectValidate - that makes avoiding the error messages much easier. The way you have it now, I don't see why you wouldn't use a drop-down or radio buttons rather than a pop-up.

Link to comment
Share on other sites

  • 3 weeks later...

Well, the point is that you SHOULD use data validation because that's your ultimate defense. You could also upgrade to v.11 where you can trigger a script OnObjectValidate - that makes avoiding the error messages much easier. The way you have it now, I don't see why you wouldn't use a drop-down or radio buttons rather than a pop-up.

I guess I am not being clear.

I do have field validation. But, I need OnRecordCommit to put the cursor INTO the omitted field. FM WILL do this but the cursor isn't visible nor is the field visible when the script uses a goto field to the omitted field. (see above on popup vs dropdown).

Link to comment
Share on other sites

This topic is 4782 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.