Home » Developer & Programmer » Forms » Move Cursor/Mouse to specific field on Form
Move Cursor/Mouse to specific field on Form [message #301944] Fri, 22 February 2008 07:24 Go to next message
nkelleher
Messages: 8
Registered: November 2006
Location: South Africa
Junior Member
Hi.

I am trying to move my mouse/cursor to a specific field on a form in CUSTOM.pll. I found the function go_item but since the custom code is in a when-validate-record event it give me and illegal error saying i can't use the go_item function.

Any more pointers would be hugely appreciated.

Thanks
Nicki
Re: Move Cursor/Mouse to specific field on Form [message #301945 is a reply to message #301944] Fri, 22 February 2008 07:31 Go to previous messageGo to next message
Littlefoot
Messages: 20892
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
A restricted procedure (such as GO_ITEM is) can not be used in triggers which fire in response to navigation (such as WHEN-VALIDATE-ITEM is).

Would it help if you set "Next Navigation Item" property to a desired item? Or, rearrange items so that "natural" walk through items reflects the requirement.
Re: Move Cursor/Mouse to specific field on Form [message #302236 is a reply to message #301945] Mon, 25 February 2008 00:38 Go to previous messageGo to next message
nkelleher
Messages: 8
Registered: November 2006
Location: South Africa
Junior Member
Thanks for the input.

This is a standard form so I can't change the order of it.
I do the validation on the invoice number field in AP Invoices and if an invoice is in a custom table, which I check for historical invoices, then it displays a message, clears the field and should go back to the invoice field.

Don't think I can use the next Navigation Item property either.

Any other ideas.
Re: Move Cursor/Mouse to specific field on Form [message #302257 is a reply to message #302236] Mon, 25 February 2008 01:25 Go to previous messageGo to next message
Littlefoot
Messages: 20892
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
It sounds that there's, actually, nothing to do!

Default behaviour is that, after validation, focus moves to the next item. If validation fails, focus stays in the current item. So, why wouldn't you use the WHEN-VALIDATE-ITEM trigger, such as
BEGIN
  do_some_validation_here;

  IF you_are_not_satisfied THEN
     MESSAGE('Validation failed because ... ');
     RAISE form_trigger_failure;
  END IF;
END;
Re: Move Cursor/Mouse to specific field on Form [message #302262 is a reply to message #302257] Mon, 25 February 2008 01:34 Go to previous message
nkelleher
Messages: 8
Registered: November 2006
Location: South Africa
Junior Member
The validation works fine but I have to do a when-validate-record because there is no when-validate-item trigger on the invoice number field in the standard form. It would be fine if there was because I could do the check on the invoice number field and the cursor would stay in the field. I know this because i did a show custom code on the form.

Is there any way of adding a when-validate-item trigger on the field?

Previous Topic: fields on a data block not getting refreshed
Next Topic: How to send a mail through oracle form
Goto Forum:
  


Current Time: Mon Dec 05 04:26:33 CST 2016

Total time taken to generate the page: 0.29033 seconds