Results 1 to 6 of 6

Thread: i am a beginner

  1. #1
    Join Date
    Jan 2006
    Posts
    4

    Question Unanswered: i am a beginner

    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
    then
    raise form_trigger_failure;
    end if ;


    I tried this on key-next-item trigger



    can anyone help me what is wrond in my code;

  2. #2
    Join Date
    Jan 2004
    Location
    Croatia, Europe
    Posts
    4,094
    Provided Answers: 4
    Validation is usually done using WHEN-VALIDATE-ITEM trigger.

    What is wrong with your code? No idea - it seems to be OK ... did you get any error messages?

    To create a list of values, FIRST create a RECORD GROUP (which, actually, contains a query), THEN create List of Values and attach it to a block item.

  3. #3
    Join Date
    Jan 2006
    Posts
    4

    Question it is not working

    the error msg in the case of lov is unalbe to


    FRM-30048: Unable to find record group .
    LOV DEPTNO
    Form: MODULE1
    FRM-30085: Unable to adjust form for output.
    Last edited by pavankumar; 01-09-06 at 17:23. Reason: ok with the when-validate item but the lov is not working

  4. #4
    Join Date
    Jan 2004
    Location
    Croatia, Europe
    Posts
    4,094
    Provided Answers: 4
    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?

  5. #5
    Join Date
    Jan 2006
    Posts
    4

    Question there is some problem with the online help

    I selected an lov using the manual wizard and i am having problem in attaching it in the data-block-item .
    do I have to change anything in the property pallette.

    I am absolutley sorry since I am just learing the things on own and can you recommend any good books and links for easy reference.

    thank you for prompt reply

  6. #6
    Join Date
    Jan 2004
    Location
    Croatia, Europe
    Posts
    4,094
    Provided Answers: 4
    Step by step instructions:

    1. Record Group

    - 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
    - Finish

    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');
    raise form_trigger_failure;
    end if;

    - 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.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •