It is quite easy to replace the seeded LOV record groups using forms personalization of simple text items but when it comes to restricting the KFF LOVs you may have no idea of how to do it and it can be clueless situation for many but here I'm sharing a simple solution for this type of requirements.
In the below example we will restrict the Item Number Lov of PO Requisitions form using a DFF attribute value. It requires a collaboration of forms personlization and custom.pll to do the task. We will use the Seeded library procedure i.e. fnd_key_flex.update_definition which allows to update the where clause of KFF Lovs.
Prereqs:
Oracle Forms Builder
PLSQL
Know-how of forms Personaliation
Steps:
1 - Open the form where you need to personalize the KFF LOV and start creating a personalization with any event trigger and any condition as per your requirement
2 - In the actions tab use Builtin action type and use Call Custom Library with a specific Event name like the following
The argument field is containing the custom event name that we will deal with in the custom.pll afterwards. You may use some other event name as per your terminology and choice.
3 - Now download the custom.pll from the AU_TOP to your local machine and open it in the form builder and edit the event procedure like the following (as per your requirement)
procedure
event(event_name varchar2) is
v_alloc_number varchar2(100);
begin
if (event_name = 'RESTRICT_ITEM_LOV')
then
v_alloc_number := name_in('PO_REQ_HDR.ATTRIBUTE1'); -- getting the attribute1 value of header dff
fnd_key_flex.update_definition
(BLOCK => 'LINES',
FIELD => 'ITEM_NUMBER',
ENABLED => 'Y',
WHERE_CLAUSE => '( INVENTORY_ITEM_ID in (Select
B.Item_Id From Cust_Po_Allocation_Header_All A,Po.Cust_Po_Allocation_Lines B
Where A.Header_Id = B.Header_Id And A.Allocation_Order_Number =
'''||v_alloc_number||''')'||')'
);
end if;
end event;
4 - Recompile the custom.pll in the form builder and upload it to AU_TOP (don't forget to backup the original file before uploading the modified one)
5 - Restart the application services and test the personalization
6 - End
Thanks