Current detail block in master detail form [message #388863] |
Thu, 26 February 2009 07:44 |
scorpio4frenz
Messages: 48 Registered: October 2008
|
Member |
|
|
I have a master-detail form with 1 master block called "companies" and 2 detail blocks, namely "in-transactions" and "out-transactions". The detail blocks are created using tabs. At any time, the master and one of the detail blocks is visible on the screen.
Both my detail blocks have a field called "transaction_type", which uses the "transaction_type" from the respective tables on which the blocks are based, and can have values "A","B", and "C". I have a button in the master saying "Create new type-A record". I'm trying to implement a functionality wherein when the user clicks that button, a new row with transaction_type = "A" should be created in the detail block that is currently on the screen. I know how to implement this for a single block once I know what block it is, but I'm getting stuck at the part where I need to determine which detail block I need to add the row to! I was initially thinking of using something like :system.cursor_block or :system.current_block but these will only give me the name of the master block since I will be in the master block when I click the button!
Can anyone provide any ideas?
I greatly appreciate any tips.
|
|
|
|
Re: Current detail block in master detail form [message #388868 is a reply to message #388865] |
Thu, 26 February 2009 07:54 |
scorpio4frenz
Messages: 48 Registered: October 2008
|
Member |
|
|
Littlefoot,
Thanks for the quick response. Yes, that is the simplest option, but as far as possible I want only 1 button doing both. Also, I have some other buttons in the master block as well and it is aesthetically pleasing to put all the buttons together on the screen!!
Any other way?
|
|
|
Re: Current detail block in master detail form [message #388882 is a reply to message #388868] |
Thu, 26 February 2009 08:35 |
scorpio4frenz
Messages: 48 Registered: October 2008
|
Member |
|
|
I have fixed my problem for the time being, but I don't like the way yet. Still looking for a better way.
Right now, I'm using something like:
declare
curblk varchar2(30);
begin
curblk := get_canvas_property('canvas_tab_1',topmost_tab_page);
if curblk = 'canvas_tab_1_page_1' then
go_block('in_transactions');
.........do the thing......
elsif curblk = 'canvas_tab_1_page_2' then
go_block('out_transactions');
........do the thing.........
end if;
end;
I'm not too fond of having to explicitly hard-code the tab canvas names. It is not very friendly to look at.
Does anyone know any alternatives to this?
Thanks, once again, for any pointers.
|
|
|
|
Re: Current detail block in master detail form [message #388992 is a reply to message #388990] |
Thu, 26 February 2009 21:44 |
scorpio4frenz
Messages: 48 Registered: October 2008
|
Member |
|
|
Djmartin, As I mentioned, I "need to" have only one button doing all the work, since it is possible to do that! Also, preferably, the button has to be in the master block with all the other buttons that do similar things. ! If you see my most recent post, I have found a way to do this using a single button. The only problem is that I have had to hard code the canvas names in it. I was looking for an alternative for that.
Thanks anyways for your input.
[Updated on: Thu, 26 February 2009 21:45] Report message to a moderator
|
|
|