oracle-databaseoracleforms

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.


Solution

  • 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;