Jeffrey Johnston
Jeffrey Johnston

Reputation: 141

SET_ITEM_PROPERTY on INITIAL_VALUE not working

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.

Upvotes: 1

Views: 5486

Answers (2)

eifla001
eifla001

Reputation: 1157

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.

Upvotes: 0

Barbaros Özhan
Barbaros Özhan

Reputation: 65218

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;

Upvotes: 2

Related Questions