Home » Developer & Programmer » Forms » clear_block v/s required fields validation behaviour (Forms 6i)
clear_block v/s required fields validation behaviour [message #376619] Thu, 18 December 2008 01:02 Go to next message
didiera
Messages: 134
Registered: August 2007
Location: Mauritius
Senior Member
Hello I need a confirmation from you. I have a form with a bunch of required fields (required property set to true on the property palette). On the same form, I tried implementing a 'cancel' button that would abort any attempt to change a record and it also has to work the same for new records i.e if I were typing values for a new record, clicking on 'cancel' would remove that record. However, I have some trouble with the required fields whose validation behaviour triggers at once and prevents me from doing my clear_block(no_validate) - I have tried a number of flavours of clear_block, clear_form etc but all fail to override that validation thing. My last resort now, in the code for the cancel button, is to supply some dummy values in the empty fields....it kinda works but is awkward to me... do you know of any graceous way of implementing this?


best regards,
Didz
Re: clear_block v/s required fields validation behaviour [message #376628 is a reply to message #376619] Thu, 18 December 2008 01:32 Go to previous messageGo to next message
Maaher
Messages: 7065
Registered: December 2001
Senior Member
This is what I understood from your message: you have a block with required fields and when you try to implement a 'cancel' button, you face Forms' validation: forms does not allow you to move away from an empty required field.

There are several options for you. I didn't test them so you need to verify or double check them.
  1. Set the 'mouse navigate' property of the button to 'FALSE'. This will cause Forms to stay in the required item and by staying there, Forms won't validate.
  2. Change the validation unit property at forms level from 'Item' to 'block', 'form' or 'record'. For an explanation about validation unit, check Forms help.
  3. Make all items optional and put the validation in the when-validate-record trigger. A messy solution but it could do the trick. Make sure that all required fields are required on the database to avoid data corruption.
Personally, I would try the solutions in the order presented.

MHE
Re: clear_block v/s required fields validation behaviour [message #376635 is a reply to message #376628] Thu, 18 December 2008 02:23 Go to previous messageGo to next message
didiera
Messages: 134
Registered: August 2007
Location: Mauritius
Senior Member
Hi

that's right. Thanks, I'll try your suggestions.


regards,
Didz
Re: clear_block v/s required fields validation behaviour [message #376636 is a reply to message #376635] Thu, 18 December 2008 02:28 Go to previous message
didiera
Messages: 134
Registered: August 2007
Location: Mauritius
Senior Member
...too cool! Solution 1 did the trick

thanks a lot!
Razz
Previous Topic: Webutil 1.0.6 slower into forms 10g
Next Topic: Union Operation in Forms
Goto Forum:
  


Current Time: Mon Feb 03 18:00:28 CST 2025