This discussion is archived
4 Replies Latest reply: Nov 21, 2013 8:54 AM by 979801 RSS

FRM 40737 error while using Go_item built in

979801 Newbie
Currently Being Moderated

Hello Expert,

I am new in Oracle forms .I am using oracle weblogic 10.3.5 with oracle forms 11g at windows 7 OS.I have some text items in a data block as:

EMP --------Data Block

|_Empno-----item.

|_Ename-----item. ----- WHEN-VALIDATE-ITEM trigger

                             |_{ In this trigger I have to check employee name.This should not contain any symbol character in name string.

                                  If

                                      it contains symbol character then the whole data in Ename Text Item would be empty and The forms control-

                                     (Focus) should reside on Ename Text Item.

                                  ELSE

                                      The forms control(focus) should go to Sal Text Item.

|_Sal-------item.

 

 

 

For this I have made a procedure to check Symbol character input at Ename Text Item.this procedure is :

declare

v_prohibited_chars VARCHAR2(100):= '!@#$%^&*';

v_result VARCHAR2(4000);

begin

v_result := TRANSLATE(EMP.Ename,'A'||v_prohibited_chars,'A');

message('Special Charecter are not allowed');

IF LENGTH(:EMP.Ename) <> LENGTH(v_result) THEN

:EMP.ENAME:='';

set_Item_Property('Emp.Ename',background_color,'r75g88b75');

go_Item('EMP.Ename');

ELSE

set_Item_Property('USER_TYPE.USER_TYPE',background_color,'white');   

go_Item('EMP.Sal');

END IF;

END;

this procedure works good.But It did not sent focus at itself(item) by using Go_ITEM built in.It flashes  FRM:40735 error.Please tell me that how can I refocus current text item again in oracle forms.

thank You

aaditya.

  • 1. Re: FRM 40737 error while using Go_item built in
    Andreas Weiden Guru
    Currently Being Moderated

    IF you want to keep the cursor in the current item when the validation fails, use RAISE FORM_TRIGGER_FAILURE instead of GO_ITEM

  • 2. Re: FRM 40737 error while using Go_item built in
    user346369 Expert
    Currently Being Moderated

    AndreasW is correct.  Also, you can never use navigational commands (like go_item, go_block, next_record, etc) in any When-Validate trigger.    When you press the Enter or Tab key, or move focus with a mouse click, those actions cause When-Validate trigger to run, and focus will move to the next field IF the When-Validate trigger does not "Raise Form_Trigger_Failure;".

  • 3. Re: FRM 40737 error while using Go_item built in
    Priyasagi Pro
    Currently Being Moderated

    979801 wrote:

    trigger: when_validate_item of ename

    declare

    v_prohibited_chars VARCHAR2(100):= '!@#$%^&*';

    v_result VARCHAR2(4000);

    begin

    v_result := TRANSLATE(EMP.Ename,'A'||v_prohibited_chars,'A');

    IF LENGTH(:EMP.Ename) <> LENGTH(v_result) THEN

    :EMP.ENAME:='';

    message('Special Charecter are not allowed');

    set_Item_Property('Emp.Ename',background_color,'r75g88b75');

    raise form_trigger_failure;

    go_Item('EMP.Ename');

    ELSE

    set_Item_Property('USER_TYPE.USER_TYPE',background_color,'white');

    go_Item('EMP.Sal');

    END IF;

    END;

    this procedure works good.But It did not sent focus at itself(item) by using Go_ITEM built in.It flashes  FRM:40735 error.Please tell me that how can I refocus current text item again in oracle forms.

    thank You

    aaditya.

    Hi, Aaditya do the above correction, if emp.sal is the immediate next item of ename then your problem will be solved above correction is enough.

  • 4. Re: FRM 40737 error while using Go_item built in
    979801 Newbie
    Currently Being Moderated

    Thanks

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points