Apply "entry" to button syntax

Phillip

Member
What is the proper syntax for applying an entry via a procedure? I was able to run the following with a test application in app builder but for some reason when I try to run it in the program I want to use it in, the command doesn't do anything

Code:
DO WITH FRAME {&FRAME-NAME}:
APPLY "entry" to button_submit.
return no-apply.
end.
 

Phillip

Member
APPLY "choose" to button_submit

Are you expecting Choose ? Or entry ? Try choose instead entry.

I want it to put a focus on that button. I tried the apply entry command to a random field that I added as a test as well and it won't apply the cursor. This is one are that it isn't working, however, I'm having issues across the board on other procedures in this program. For instance, if there is an error in the quantity of one field, I have it go to the previous field and apply the cursor but it won't run. I can apply via the triggers but not through a procedure.
 

Phillip

Member
Another option is if there is a way to put a tab and reverse tab command in that would work. I could have it tab next or tab back to the fields I need.
 

TheMadDBA

Active Member
You can't do the RETURN NO-APPLY in a procedure since it will not stop the trigger event from firing. You have to use RETURN NO-APPLY in the trigger itself.

If you need to know if the RETURN NO-APPLY should be performed or not you will need to return a value from the procedure/function call.

Code:
ON LEAVE OF FILL-IN-1 IN FRAME DEFAULT-FRAME /* Fill 1 */
DO:
  RUN p_doit.
  RETURN NO-APPLY.
END.

PROCEDURE p_doit :
DO WITH FRAME {&FRAME-NAME}:
 APPLY "entry" TO button-1.
END.

END PROCEDURE.
 

Phillip

Member
You can't do the RETURN NO-APPLY in a procedure since it will not stop the trigger event from firing. You have to use RETURN NO-APPLY in the trigger itself.

If you need to know if the RETURN NO-APPLY should be performed or not you will need to return a value from the procedure/function call.

Code:
ON LEAVE OF FILL-IN-1 IN FRAME DEFAULT-FRAME /* Fill 1 */
DO:
  RUN p_doit.
  RETURN NO-APPLY.
END.

PROCEDURE p_doit :
DO WITH FRAME {&FRAME-NAME}:
APPLY "entry" TO button-1.
END.

END PROCEDURE.

This solved it! Thank you!
 
Top