This content has been marked as final. Show 4 replies
Another idea cross to ...
Creating more than a lov with different RGs
Call each in When validate item trigger within if statement block
IF :FIELD1 IN (1,2,3....) THENOr creating than lov for more than a RGS , in this case u have to change the record group before displaying LOV
If line_type = 'B',' field 1 should default to a value called 'DEFAULT'. The fields along with the LOVs should be disabled.Well, you code sample for your Key-ListVal would not disable the fields, simply cause the LOV to not be shown. Also, looking at your code, if your "LINE_TYPE" field allows mixed-case, your code will not consistently supress the LOV. Try:
Also, if your truly want the fields in rows where LINE_TYPE='B' to be disabled, you can't use the Key-ListVal trigger for this. I would recommend using the When-New-Record-Instance (WNRI) and the Post-Query (PQ) triggers. The WNRI would handle records being created while the PQ will handle existing records queried into your block. The code would look something like:
declare b1 Boolean; begin if(UPPER(line_type) = 'B') then null; elsif(UPPER(line_type) = 'A') THEN b1 := SHOW_LOV('LOV_ON_FIELD1'); END IF; END;
Hope this helps,
/* Sample Disable code for Multi-Row block */ /* This code would be used in both triggers */ BEGIN -- Check if row should be disbled and FIELD_1 defaulted to "DEFAULT" IF ( UPPER(:YOUR_BLOCK.LINE_TYPE) = 'B' ) THEN Set_Item_Instance_Property('YOUR_BLOCK.YOUR_ITEM1',INSERT_ALLOWED,PROPERTY_FALSE); Set_Item_Instance_Property('YOUR_BLOCK.YOUR_ITEM1',UPDATE_ALLOWED,PROPERTY_FALSE); Set_Item_Instance_Property('YOUR_BLOCK.YOUR_ITEM1',VISUAL_ATTRIBUTE,'DISABLED_ITEM'); /* Do this for each item in the row you want disabled. */ /* This sample assumes you have a set Visutal Attributes named */ /* "DISABLED_ITEM" and "ENABLED_ITEM" */ ELSE --Ensure the each item is enabled. Set_Item_Instance_Property('YOUR_BLOCK.YOUR_ITEM1',INSERT_ALLOWED,PROPERTY_TRUE); Set_Item_Instance_Property('YOUR_BLOCK.YOUR_ITEM1',UPDATE_ALLOWED,PROPERTY_TRUE); Set_Item_Instance_Property('YOUR_BLOCK.YOUR_ITEM1',VISUAL_ATTRIBUTE,'ENABLED_ITEM'); /* Do this for each item in the row you want disabled. */ END IF; END;
No longer relevant for our case.
But you are of course grateful and thankful for the people who have volunteered their help in the thread above.