Home » Developer & Programmer » Forms » exception show in forms
exception show in forms [message #282118] Tue, 20 November 2007 23:21 Go to next message
roni_a180
Messages: 45
Registered: October 2007
Member
i write a following code

  PROCEDURE VALIDATE_OPERATION(PRIGHTSID IN NUMBER, PUSERID IN VARCHAR2) IS
	LRIGHTID NUMBER;
	LRIGHTSNAME VARCHAR2(255);
	LBRANCHID NUMBER;
	BEGIN

	LBRANCHID := GET_USER_BRANCH(PUSERID);

	LRIGHTSNAME := APP_SECURITY.RIGHTSNAME(PRIGHTSID);
	BEGIN
		 SELECT DISTINCT rt.ID INTO LRIGHTID
	 FROM USERINFO usr, USERROLE usrrl,ROLERIGHTS rlrt,RIGHTS rt
	 WHERE
	 usr.ID = usrrl.USERID
	 AND rlrt.RIGHTSID = rt.ID
	 AND rt.ID = PRIGHTSID
	 AND usrrl.ROLEID = rlrt.ROLEID
	 AND UPPER(usr.USERNAME) = UPPER(USER) ;

	EXCEPTION
		WHEN NO_DATA_FOUND THEN
		COMMON.RAISEEXCEPTION('User has no right to perform the operation: "'|| LRIGHTSNAME ||'"') ;
	END;


	IF IS_LOGGED_IN(PUSERID) = FALSE THEN
	   COMMON.RAISEEXCEPTION('Can not perform operation, User is not logged in.') ;
	END IF;

	IF IS_BRANCH_OPEN(LBRANCHID) = FALSE THEN
	   COMMON.RAISEEXCEPTION('Can not perform operation, Branch is not open.') ;
	END IF;

ther r 2 input rightid , userid

then if which conditon full fill return the particular error message and i catch this message and show this message in forms in forms text field

Upd-mod: Add 'code' tags.

[Updated on: Tue, 20 November 2007 23:32] by Moderator

Report message to a moderator

Re: exception show in forms [message #282145 is a reply to message #282118] Wed, 21 November 2007 00:18 Go to previous message
Littlefoot
Messages: 21823
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
Is it a stored procedure? It seems so, because - if it was a Forms one, you'd be able to do it already. Right?

Now, you might add another OUT parameter to the procedure and return a message string to form in order to display it in a text item. Or, you might even change a procedure to a function and RETURN error message. Whichever you prefer might do the job.
Previous Topic: how can i run .fmx over internet explorer
Next Topic: Forms and Reports
Goto Forum:
  


Current Time: Sun Feb 02 21:49:11 CST 2025