Using the following code, I'm trying to set the property of INITIAL_VALUE in the form field named STATUS depending on the condition. The following code is on PRE-TEXT-ITEM trigger.

BEGIN IF (:LOAN.STATUS = 'A') THEN SET_ITEM_PROPERTY(:LOAN.STATUS,INITIAL_VALUE,'Active'); ELSIF (:LOAN.STATUS = 'I') THEN SET_ITEM_PROPERTY(:LOAN.STATUS,INITIAL_VALUE,'Inactive'); END IF; END; 

Putting the following code outside of the condition doesn't work as well.

SET_ITEM_PROPERTY(:LOAN.STATUS,INITIAL_VALUE,'Active'); 

Please advise what I'm doing wrong.

2 Answers

When referring Forms' help, seen that there's no such property(second argument) INITIAL_VALUE for SET_ITEM_PROPERTY method. Instead, you might assign the desired value for the item directly in PRE-TEXT-ITEM trigger as below :

BEGIN IF (:LOAN.STATUS = 'A') THEN :LOAN.STATUS := 'Active'; ELSIF (:LOAN.STATUS = 'I') THEN :LOAN.STATUS := 'Inactive'; END IF; END; 

or abbreviately fill the trigger with the following code instead of the above :

select decode(:LOAN.STATUS,'A','Active','I','Inactive') into :LOAN.STATUS from dual; 
3

You can also put a value like below in the INITIAL VALUE property.

:OTHER_BLOCK.OTHER_ITEM

and by doing this, that item referenced in the INITIAL VALUE property is now like a variable.

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.