Smart questions
Smart answers
Smart people
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Member Login

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips now!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

Join Tek-Tips
*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

LINK TO THIS FORUM!

Add Stickiness To Your Site By Linking To This Professionally Managed Technical Forum.
Just copy and paste the
code below into your site.

Partner With Us!

"Best Of Breed" Forums Add Stickiness To Your Site
Partner Button
(Download This Button Today!)

Feedback

"...you guys have given us a way of asking a question and getting some very timely feedback from other users so we don't have to re-invent the wheel time and again..."

Geography

Where in the world do Tek-Tips members come from?
tpbjr (MIS)
29 Sep 05 17:35
Hi,

I am popping up an aleart then after the user clicks the ok button I want focus to go to a specific text box but I am not having any luck!  This is Oracle form developer version 6.5

I appreciate any help.
Thank you for all your help

Thank you for all your help

www.besware.com
Tom

Helpful Member!  BJCooperIT (Programmer)
29 Sep 05 20:37
Have you added a

CODE

GO_ITEM(field_name);
after your code to issue the alert? It must be positioned before any

CODE

RAISE FORM_TRIGGER_FAILURE;

Beware of false knowledge; it is more dangerous than ignorance. ~George Bernard Shaw
Consultant Developer/Analyst Oracle, Forms, Reports & PL/SQL (Windows)
Author and Sole Proprietor of: Emu Products Plus

sem (Programmer)
30 Sep 05 2:36
Do you have any specific issues?
Could you post a piece of your (failing?) code before I suggest mine?

Regards, Dima
http://seminihin.narod.ru

tpbjr (MIS)
30 Sep 05 8:14
GO_ITEM(field_name);
was exactly what I need.

Thank you so much.

Thank you for all your help

www.besware.com
Tom

tpbjr (MIS)
30 Sep 05 8:35
Well--it partially works.

If I am on another object such as a LOV or different text box then the go_item command works.  But if the cursor is in :blk_rpt_parm.journal_type and I issue the go_item('blk_rpt_parm.journal_type') command I get the following error.

FRM40737 - Illegal restricted procedure GO_ITEM in WHEN-VALID-ITEM trigger.

Basically, if call the following function while the cursor is not in the :blk_rpt_parm.journal_type text box, it works, but if the cursor is in side the :blk_rpt_parm.journal_type text box it gives the FRM40737 error.


FUNCTION LaborRelated RETURN BOOLEAN IS
BEGIN        
    
    if :blk_rpt_parm.journal_type in ('LU','LO','LT','LF','LA','LR')
    then        
      :journal_desc := null;    
      :blk_rpt_parm.journal_type := null;
      if show_alert('alert_report_disabled')= alert_button1 then      
          go_item('journal_type');        
          return true;
        end if;                    
    end if;
    return false;
    
END;


Thank you for all your help

www.besware.com
Tom

tpbjr (MIS)
30 Sep 05 9:01
Ok, here is what I came up with and it works, but if you have a cleaner way to do the same thing I would appreciate your input.

I call the function and pass it true or false.  I pass it true if I am calling it from the textbox that has the current focus and I want focus to stay there if labor is detected.  If the cursor is in any other location I call the function with false.


FUNCTION LaborRelated (NoGOITEM BOOLEAN) RETURN BOOLEAN IS
BEGIN        
    
    if :blk_rpt_parm.journal_type in ('LU','LO','LT','LF','LA','LR')
    then        
      :blk_rpt_parm.journal_desc := null;    
      :blk_rpt_parm.journal_type := null;
      if show_alert('alert_report_disabled')= alert_button1 then      
          if NoGoItem
          then
              RAISE Form_Trigger_Failure;  
          else
              go_item('journal_type');        
          end if;
          return true;
        end if;                    
    end if;
    return false;
    
END;

Thank you for all your help

www.besware.com
Tom

BJCooperIT (Programmer)
30 Sep 05 9:15
You cannot perform navigation in a validation trigger which was why you were getting the error. This insures that the cursor does not leave a field that contains an invalid value.

My preferred way of handling this is to have funtions do pure validation and pass back a success/failure. That way the code that invokes the function can determine what it needs to do based on the returned status. For instance, the validation trigger can then determine the value was invalid, issue an error message and then fail. Any other code that invokes the function can do navigation or whatever is required.

Beware of false knowledge; it is more dangerous than ignorance. ~George Bernard Shaw
Consultant Developer/Analyst Oracle, Forms, Reports & PL/SQL (Windows)
Author and Sole Proprietor of: Emu Products Plus

tpbjr (MIS)
30 Sep 05 15:27
I have it working perfectly now.  You all have been a great help.

Thanks again.

Thank you for all your help

www.besware.com
Tom

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close