using the emp table in the scott schema i am trying to validate the empno,ename ,job and salary .
and also want to add lov to the dept item in the form that i created by choosing the above database items
the code i am trying is
if :empno > 10000
end if ;
Use of the WHEN-VALIDATE-ITEM trigger is really trivial if you, well, use it properly. Did you attach it to the correct place? It should be exactly :block.empno item-level trigger (not block or form level).
List of values: what exactly isn't working? Did you follow online help instructions?
- Enter the following query: select d.deptno, d.dname from dept d order by 2
- Rename record group to RG_DEPT
2. List of Values
- Use the LOV Wizard.
- Base LOV on Existing Record Group. You'll already see it (as RG_DEPT is the only one you have at the moment).
- Modify existing Record Group.
- Include both columns into your LOV.
- Look up return item:
. - for the DEPTNO column choose 'EMP.DEPTNO' as return value
. - for DNAME select nothing
- Assigned items: EMP.DEPTNO
Rename list of values to LOV_DEPT
LOV_DEPT property palette:
- Adjust Width and Height (under Physical properties) to (depending on your measurement unit) 450 x 450 (or 4500 x 4500 or ...). You can always change it if necessary.
3. EMP.DEPTNO property palette
- List of Values: it will already be assigned to LOV_DEPT
4. On the canvas, right click EMPNO item, choose "Smart Triggers", choose "WHEN-VALIDATE-ITEM".
- In the PL/SQL Editor write this text:
if :emp.empno > 10000 then
message('Empno too large');
- Compile the trigger
5. Generate and execute the form.
- if you enter EMPNO value larger than 10000 you'll receive a message that the EMPNO value is too large.
- pressing <List of Values> button on DEPTNO item will display list of values.
All this can be found in Forms online help (press <Ctrl + H> while in Forms Developer and use it). Furthermore, check Oracle documentation. Forms are discussed under Development Tools.