set_item_property.. [message #640306] |
Mon, 27 July 2015 03:00 ![Go to next message Go to next message](/forum/theme/orafaq/images/down.png) |
![](http://www.gravatar.com/avatar/481ad83bfa916e6a93b0af5b8a5f5d53?s=64&d=mm&r=g) |
palpali
Messages: 138 Registered: December 2014 Location: India
|
Senior Member |
|
|
Hallo All..
I have master-detail with two detail blocks.
and i am trying to set some item property insert/update = true/false as per my condition.
i wrote this code in When-New-Record-Instance Trigger in Master-Block.
But, my third condition does not works as i wanted to have. If both condition matched then should allowed to update and insert otherwise allow just in one of them.
if condition1 = 1 then
set_item_property('Block1.item1', insert_allowed, property_true);
set_item_property('Block1.item2', update_allowed, property_true);
............... ............ ........... .........
set_item_property('Block2.item1', insert_allowed, property_false);
set_item_property('Block2.item1', update_allowed, property_false);
................ ........... ............. ...........
elsif condition2 = 1 then
set_item_property('Block2.item1', insert_allowed, property_true);
set_item_property('Block2.item2', update_allowed, property_true);
........................... ....................
set_item_property('Block1.item1', insert_allowed, property_false);
set_item_property('Block1.item1', update_allowed, property_false);
.............. ............. ........... .............
else
set_item_property('Block1.item1', insert_allowed, property_true);
set_item_property('Block1.item2', update_allowed, property_true);
............... ............ .......... ..........
set_item_property('Block2.item1', insert_allowed, property_true);
set_item_property('Block2.item1', update_allowed, property_true);
............. .............. ............ ............
end if;
How can i do this? Can anyone please help me?
thankx in advance
Regards,
|
|
|
Re: set_item_property.. [message #640308 is a reply to message #640306] |
Mon, 27 July 2015 03:15 ![Go to previous message Go to previous message](/forum/theme/orafaq/images/up.png) ![Go to next message Go to next message](/forum/theme/orafaq/images/down.png) |
cookiemonster
Messages: 13937 Registered: September 2008 Location: Rainy Manchester
|
Senior Member |
|
|
If you want both conditions matching to trump everything else then you need to check that first.
IF/ELSIF constructs find the first IF that evaluates to TRUE and run that.
|
|
|
|
Re: set_item_property.. [message #640310 is a reply to message #640309] |
Mon, 27 July 2015 03:35 ![Go to previous message Go to previous message](/forum/theme/orafaq/images/up.png) ![Go to next message Go to next message](/forum/theme/orafaq/images/down.png) |
cookiemonster
Messages: 13937 Registered: September 2008 Location: Rainy Manchester
|
Senior Member |
|
|
You've failed to understand my point. If both conditions match it will run the code in the first IF. You'll only get the ELSE if neither match.
|
|
|
|
|
|
|
|
Re: set_item_property.. [message #640331 is a reply to message #640329] |
Mon, 27 July 2015 06:40 ![Go to previous message Go to previous message](/forum/theme/orafaq/images/up.png) ![Go to next message Go to next message](/forum/theme/orafaq/images/down.png) |
![](http://www.gravatar.com/avatar/481ad83bfa916e6a93b0af5b8a5f5d53?s=64&d=mm&r=g) |
palpali
Messages: 138 Registered: December 2014 Location: India
|
Senior Member |
|
|
Hallo Cookiemonster..
Well, I have master-Detail block and i want to insert new records in my Detail-block. Actually, some of them fields are same as previous records but just Need to Change one field in new records. for e.g.:
item1 item2 item3 item4
text1 abc def ghi@klm.com
"" "" "" mno@pqr.com
..... ..... .... ..........
..... ..... .... ..........
in my case: when i goto next row then it should Display all the records till item3 (like: in item1: text1, in item2: abc, and in item3: def and in item4: will be inserted new email address) in the current row, and will Change or insert new email address in item4.
Any Suggestion or help please? thanking you in advance.
Regards,
PS: sorry for formating.
[Updated on: Mon, 27 July 2015 06:43] Report message to a moderator
|
|
|
Re: set_item_property.. [message #640351 is a reply to message #640331] |
Mon, 27 July 2015 08:25 ![Go to previous message Go to previous message](/forum/theme/orafaq/images/up.png) ![Go to next message Go to next message](/forum/theme/orafaq/images/down.png) |
cookiemonster
Messages: 13937 Registered: September 2008 Location: Rainy Manchester
|
Senior Member |
|
|
Create a control block with items for item1 - item3.
Add a When-Validate-Item trigger to each item in the detail block so that whenever one is changed it's current value is copied to the equivalent item in the control block.
In the When-New-Record-Instance trigger on the detail block check the record_status - if it's new copy the current values from the control block items to the corresponding items in the control block.
|
|
|
|
|
|
|
|
|