This content has been marked as final. Show 7 replies
You should use two triggers :
1. when-new-record-instance -> in this trigger you should check the value of "List item". If the "List item" is empty you have to set all the item editable. If the "List item" is not empty you have to set items properly as per your needs regarding "List item" value.
2. when-list-changed -> Change the editable property of items appropriately depending on value selected in "List item"
The point here is you have to set/unset items in every row the user navigates to. That is done by when-new-record-instance trigger.
Hope this helps
I agree with Gregor using the WHEN-LIST-CHANGED-trigger. But i would not set the properties INSERT_ALLOWED and UPDATE_ALLOWED in a WHEN-NEW-RECORD-iNSTANCE-trigger, but set them in the WHEN-LIST-CHANGED-trigger and in the process of filling the block(i don't know how the block is populated, if its done using EXECUTE_QUERY the trigger would be the POST-QUERY-trigger).
The statement to make an item in the current record insertable is
SET_ITEM_INSTANCE_PROPERTY('BLOCK.ITEM', TO_NUMBER(:SYSTEM.TRIGGER_RECORD), INSERT_ALLOWED, PROPERTY_TRUE); SET_ITEM_INSTANCE_PROPERTY('BLOCK.ITEM', TO_NUMBER(:SYSTEM.TRIGGER_RECORD), UPDATE_ALLOWED, PROPERTY_TRUE);
The built-in SET_ITEM_INSTANCE_PROPERTY you suggested is only applicable when data are retrieved from database but not when the user inserts a new record. My point/assumption is the requirement is also this : "if user creates a new record and set the list item to some value there should also be mentioned (items enabled/disabled) business logic involved."
Yes that exactly is my requirement. When I choose a value from the list item the items should be enabled or disabled.
When I choose 'MANUAL' that whole row (i.e. the items in the row should be editable) as I am inserting a new record in that particular row.
But when I choose 'AUTO' or 'ADVANCE' only two items in that row should get edited while all the other items should remain uneditable.
The data gets populated with an execute_query.
Now when I tried setting set_item_instance property on the list item here is the scenario:
When I choose 'MANUAL' initially for first time the whole row is editable but when i choose the rest of the two, what happens is, the set_item_instance property is fired and all the remaining columns are set as per editable/uneditable. Now again when I choose 'MANUAL' the item properties are not fired according to this list item(as in the whole row does not become editable).
Also it should not happen that first when I choose MANUAL, then AUTO or ADVANCE and again MANUAL the row with the list item AUTO or ADVANCE which is in between, becomes editable totally.
Thanx Andreas, that really saved my time as I read a lot but did not find the right suggestions.
Would like to have suggestions for 2 more threads posted :
1)problem with set_item_instance_property and set_lov_property
2)setting property on radio button status
Edited by: 1005292 on May 20, 2013 12:25 PM