Jump to content

Trying to disable the Revert Record dialog


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

Recommended Posts

I have a date field in a customer order entry layout.

I have put a custom dialog in the field properties if validation fails. It is done by calculation which I guess explain why it is the only field that shows a ''Revert'' option in my custom dialog box.

As users don't have a clue what this is, I need to get rid of it.

My calculation to validate the date is as follows: DateCedule ≥ Get(CurrentDate) and DateCedule ≤ (Get(CurrentDate)+184

That translate to anywhere between today's date and no more than 6 months from today.

I read in forums that the common way to avoid the Revert in a dialog box is to include a formula that changes color of the field. Using examples, I now have this formula:

If(DateCedule ≥ Get(CurrentDate) and DateCedule ≤ (Get(CurrentDate)+184); TextColorRemove(DateCedule; RGB(200;0;0) ) ; TextColor(DateCedule; RGB(0;0;0)))

Obviously, it contains a huge (or dumb) error as it doesn't do anything!

Can someone help me? I have a hard time with formulas in general as I am still a novice.

Link to comment
Share on other sites

Update to my own topic:

In the properties of the field I could maybe use the ''in range'' option instead of a calculation.

But whatever entries I put there, It performs nothing in terms of validation.

What is the proper syntax to express ''between today and 183 next coming days'' in the ''in range'' option ?

Of course, the field has a Date format.

Link to comment
Share on other sites

I think you were on the right track with a calculated validation. I don't know what you are trying to accomplish though. Do you want to validate the value of the field, or don't you? If you want to validate it, then the Revert button is there to stay.

Do you want to allow a value that is not in your specified range, and just show the user that it is not valid? If so, then you could use that same basic calculation (the first one) in conditional formatting, and apply red text (or whatever you want) if the value is out of the specified range.

Link to comment
Share on other sites

I just want to force the user to correct his mistake.

If the revert field is pressed, it is then followed by a Revert Record dialog. If he presses it, he gets kicked out to the main menu and has to start over.

That is not elegant at all. So far my only option is to instructs users not to press it ...!!

Any idea about the proper syntax to express (''between today and 183 next coming days'') in the ''in range'' option of the field's properties?

Link to comment
Share on other sites

Can someone help me?

Get rid of that validation formula and try this one.

1) Do not set any validation formula for that field

2) Create a new script:

If [ Get ( ActiveFieldContents ) < Get ( CurrentDate ) or Get ( ActiveFieldContents ) > Get ( CurrentDate ) + 183 ]

Show Custom Dialog [ "This date is wrong" ] // enable only the OK button

Clear [ Select ]

End If

3) Set that field to trigger the above script by OnObjectValidate

Link to comment
Share on other sites

Any idea about the proper syntax to express (''between today and 183 next coming days'') in the ''in range'' option of the field's properties?

You can't. The "in range" option contains static values, "today" is a dynamic value. Also, I've never used that for anything other than numbers, so I don't even know if it works/how it works on a date field.

That won't solve your problem anyways, the user will still get an option to revert. That option always exists if you use field validation. If you don't want it, you will need to use another method to validate data entry.

edit: I didn't see Raybaudi's post before I posted

Edited by dansmith65
Link to comment
Share on other sites

After checking carefully, I still have the Revert Field message.

However, the field does revert (which is fine) and the Revert Record dialog box does not appear now.

That means the user doesn't get kicked out to main menu anymore, this is what I needed.

Thanks for the help.

SD

Link to comment
Share on other sites

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