Home » Developer & Programmer » Forms » Validation in forms
Validation in forms [message #440214] Thu, 21 January 2010 12:03 Go to next message
mithu
Messages: 11
Registered: July 2008
Junior Member
Hi

I need solution to the following isues

Based on a number field and date field i am fetching some data.It contains 4 columns
2 columns are noneditable and the other are entered by user

eg:
A (Display only)    B  (Display only)    C           D
   00                    ABC             5           33
   10                    XYZ             67          28
   12                    UVW             88          22
1. First Issue: I should be able to enter 5,when I press tab for first entry it should go to D where i enter 33 and when i press tab it should go to 67
2. Second Issue.The number of rows are not fixed .If 4 rows are fetched than 5th row and rows after that should get disabled.
3.After data is fetched my cursor goes to the row after the last row.. i.e. 5th row but it should come in first row Column C so that i can enter data
4.Only number is allowed in field C and user should get a message on screen(Setting in property pallete is not an option)
5. value in D>C ,so whenever i press tab from D user should get a prompt.

Please let me knw the solution

Regards
M.
[EDITED by LF: applied [pre] tags]

[Updated on: Thu, 21 January 2010 12:43] by Moderator

Report message to a moderator

Re: Validation in forms [message #440215 is a reply to message #440214] Thu, 21 January 2010 12:12 Go to previous messageGo to next message
cookiemonster
Messages: 13960
Registered: September 2008
Location: Rainy Manchester
Senior Member
1) Are A and B set to be display items or have you disabled them some other way? If they are actually display items then the behavour you've described should be what happens.
2) Set insert_allowed to No at block level.
3) How are you populating the block? I'm guessing you are not using execute_query here (and if so I might need to change my answer to 2).
4) I strongly disagree, setting it to number in the property pallete is the only sensible approach.
5) The best place to compare 2 fields in the same row is in WHEN-VALIDATE-RECORD
Re: Validation in forms [message #440216 is a reply to message #440215] Thu, 21 January 2010 12:19 Go to previous messageGo to next message
mithu
Messages: 11
Registered: July 2008
Junior Member
1. A and B are display items
2. to populate the block i am using a for loop inside which i am using next_record.so i cannot use insert_allowed false
3.


4.Since the user should get a message on the screen that please enter a number.hw will i do that?
5. In when validate record how will I get the value in C because for D i can use system.current_value


Regards
M.
Re: Validation in forms [message #440227 is a reply to message #440216] Thu, 21 January 2010 13:01 Go to previous message
Littlefoot
Messages: 21823
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
  1. check what is block navigation behaviour set to; when you press <Tab> on the last record item, what happens? Set it to "navigate to next record"
  2. Yes, you can set it to FALSE - at the end of the loop (outside of the loop, actually), use SET_BLOCK_PROPERTY and set INSERT_ALLOWED to FALSE.
  3. After you have populated a block, use FIRST_RECORD to go to the top
  4. User won't get exactly that message, but something like "Allowed values are 0-9, +, -, E". Or, try to trap that message in ON-ERROR (or ON-MESSAGE; I'm not sure whether a character in a NUMBER item is an error or a message) trigger and display your own message
  5. By ":block.item" notation; something like
    if :block.item_d < :block.item_c then
       message('D should be > than C');
       raise form_trigger_failure;
    end if;
Previous Topic: When-Button-Pressed Trigger Code to cover three scenarios
Next Topic: Where clause in select statement using forms 10g
Goto Forum:
  


Current Time: Tue Dec 03 18:56:55 CST 2024