how to tell what form is currently open

hi all,

is there a way to tell which form is currently open? or if a form is currently open?

Situation:

  1. The user opens a form with some text fields.
  2. places the form into an editable status
  3. changes some value that does not conform with ondatachange event
  4. while that field is still in focus, the user clicks save
  5. ondatachange event opens a dialog stating that this value is not valid.
  6. ondatachange event sets that value to null
  7. application continues to save record after we clear that field.

Is there any way to stop the save method from continuing? I was thinking I could utilize some method that would tell what form was open.
currentcontroller.getFormContext()[0][1] works only the first time. After the user closes that dialog it comes back with the original form name

Hi ?,

We do :

  1. ondatachange event sets that value to the old value

This way the following save is ok.

PS. I consider showing your own full name in the forum as friendly.

Regards,

Thanks for the reply Lambert,

We set the value to null to allow the save, but our users are not too happy with a value they’ve entered disappearing and then having to activate edit mode and renter the value etc.

I guess the main issue is getting the application to stop that process and allow the user to rectify their error before the continuing with the save.

There are no problems if the user changes focus and then proceeds to do the save.

I just thought if i could get the top most form at the time, because its a modal dialog, then i would be able to stop the save from happening.

Using currentcontroller.getFormContext()[0][1] works the first time, meaning it does pick up the correct form name. But, if the user enters another invalid value, the form name passed is incorrect the second go round.

Hi Ernest,

You can set a form or global variable when the error is displayed and the save function can check that variable…

Some housekeeping must be done for such a flag. If you work with your own ‘standard’ UI functions for error / warning display you have less work to implement application wide.

Regards,