Search code examples
oracleformsoracle-ebs

Oracle EBS R12 - Form Personalization - Disable a particular field


User should not update the Ordered Quantity Fields in the tabs ie (Pricing ,Shipping,Addresses,Returns,Service,Others) if it satisfies a certain condition. If someone tries to update - just pop-up an error message

"Update not allowed here !!"

I think we can achieve this using Form Personalization. But I am not sure actually (Trigger Event,Trigger Object,Condition) - how to disable particular field

Kindly Help. Let me know if you need any more inputs


Solution

  • It depends on your condition, if it depends on record data, if it can change when user changes data, etc.

    If the condition is constant during forms session, use WHEN-NEW-FORM-INSTANCE trigger like this

    if _condition_ then
        set_item_property('your_block.item1', UPDATE_ALLOWED, PROPERTY_FALSE);
        set_item_property('your_block.item2', UPDATE_ALLOWED, PROPERTY_FALSE);
        ...
    end if;
    

    if your condition depends on record data, use POST-QUERY trigger in similar way

    if _condition_ then
        set_item_instance_property('your_block.item1', :SYSTEM.TRIGGER_RECORD, UPDATE_ALLOWED, PROPERTY_FALSE);
        set_item_instance_property('your_block.item2', :SYSTEM.TRIGGER_RECORD, UPDATE_ALLOWED, PROPERTY_FALSE);
        ...
    else
        set_item_instance_property('your_block.item1', :SYSTEM.TRIGGER_RECORD, UPDATE_ALLOWED, PROPERTY_TRUE);
        set_item_instance_property('your_block.item2', :SYSTEM.TRIGGER_RECORD, UPDATE_ALLOWED, PROPERTY_TRUE);
        ...
    end if;
    

    if your condition depends on record data, which can user modify use additional WHEN-VALIDATE-RECORD trigger whith the same code as the POST-QUERY-TRIGGER