Home » Developer & Programmer » Application Express, ORDS & MOD_PLSQL » Apex 5 Master Detail Form (oracle 11g,apex5 and windows server 2012)
Apex 5 Master Detail Form [message #656476] Fri, 07 October 2016 07:32 Go to next message
knd.prasad
Messages: 35
Registered: December 2009
Location: HYDERABAD
Member
Hi,

I am New to apex, How to fill detail region based on master region Coloumn .


http://192.168.0.4:8082/apex/f?p=100:21:5101352949922:::::


thanks
prasad
Re: Apex 5 Master Detail Form [message #656515 is a reply to message #656476] Sun, 09 October 2016 13:37 Go to previous messageGo to next message
Littlefoot
Messages: 21823
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
I'm afraid I don't understand what you mean.

Do you know what "master-detail" relationship is?

How did you create master-detail form? Did you use a wizard? If not, I'd strongly suggest you to do so because, saying that you are new to Apex, it'll take ages until you make it properly work. Besides, why bother? That's what wizard is here for.

Anyway: if you carefully follow(ed) the wizard, it sets everything up and your master-detail form just works, there's nothing much you have to do. OK, you can make it fancy, but - generally speaking - it is fully operational.

So, what exactly do you mean by saying "how to fill detail region based on master region column"? There's the "Add row" button which creates a new, empty row in the detail block so you fill data in, literally type information into items.

Finally, what are we supposed to do with a link you posted? If you wanted to share your Apex application/page with us, you should have done that by creating it on apex.oracle.com & posting login information so that someone might have a look.
Re: Apex 5 Master Detail Form [message #656595 is a reply to message #656476] Wed, 12 October 2016 05:23 Go to previous messageGo to next message
knd.prasad
Messages: 35
Registered: December 2009
Location: HYDERABAD
Member
how to add image in this message


thanks in advance
Re: Apex 5 Master Detail Form [message #656622 is a reply to message #656595] Wed, 12 October 2016 15:38 Go to previous messageGo to next message
Littlefoot
Messages: 21823
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
Don't use "Quick reply" option; look at the right bottom end of every message - you'll see the "Reply" button there. Click it. In there, you'll see an option to add an attachment. So - take a screenshot (I guess that's the "image" you're talking about), save it on your computer and then add it to your next message.

If you're unsure of how to properly do it, we have a Test forum; open a new topic and practice anything you want there. Once you figure out how to do it, do it here as well.
Re: Apex 5 Master Detail Form [message #656634 is a reply to message #656622] Thu, 13 October 2016 00:09 Go to previous messageGo to next message
knd.prasad
Messages: 35
Registered: December 2009
Location: HYDERABAD
Member
Hi,

In image master and detail regions are there . in master region Inv No is lov. I have selected one invoice no

i.e, STA/233. In this invoice 50 records are there. once i selected any invoice number dynamically fill the detail region.

I don't want to add each record in detail region.

Please tell me how to fill the detail region dynamically.

I have added image for reference.

Thanks in advance
prasad


/forum/fa/13286/0/

[Updated on: Thu, 13 October 2016 00:24]

Report message to a moderator

Re: Apex 5 Master Detail Form [message #656664 is a reply to message #656634] Thu, 13 October 2016 14:48 Go to previous messageGo to next message
Littlefoot
Messages: 21823
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
I'm sorry, but I still don't understand what you have and what you want to do. There are two options I can think of.

The first one: once you select "Inv. No" value, you want to fetch all 50 records that already exist in the detail table. If that's so, once again: if master-detail relationship is correctly set, Apex engine will do that automatically.

The second one: once you select "Inv. No" value, there are currently no detail records for that Inv. No., but you want to automatically create 50 detail records for it (instead of pressing the "Add Row" button manually 50 times). If that's so, you'll have to write some code; I (or someone else) can help you do that.

So, which one of these two are you talking about? Or, is there the third option? If so, which one is it?
Re: Apex 5 Master Detail Form [message #656668 is a reply to message #656664] Thu, 13 October 2016 23:30 Go to previous messageGo to next message
knd.prasad
Messages: 35
Registered: December 2009
Location: HYDERABAD
Member
Hi,

I am talking about second option. how to write that code.
Give me some plsql example to fill the detail region.

Thanks
prasad
Re: Apex 5 Master Detail Form [message #656671 is a reply to message #656668] Fri, 14 October 2016 01:17 Go to previous messageGo to next message
Littlefoot
Messages: 21823
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
Here's an example based on Scott's DEPT and EMP (master and detail) tables.

Using a wizard, I created a master-detail page(s). Master's DEPTNO column is a primary key in the DEPT table and foreign key in the EMP table, so that's the value I have to provide in order to maintain master-detail relationship. Another value EMP table expects is the EMPNO; I'm using one of row generator techniques to acquire that value. As there are no other NOT NULL columns in the detail (EMP) table, I won't insert any other value.

In order to do that (page number = 16):
  • create "Number item" in master block (P16_NUM) which tells how many rows you want to create
  • create a button in master block (P16_BTN_CREATE) which submits the page
  • create a PL/SQL process that fires on submit and looks like this:
    declare
      l_max_empno emp.empno%type;
    begin
      select nvl(max(e.empno), 0) 
        into l_max_empno
        from emp e;
    
      insert into emp (deptno, empno)
        select :P16_DEPTNO, l_max_empno + level
        from dual
        connect by level <= :P16_NUM;
    end;
  • run the page
  • enter some value into the P16_NUM item and press the button; the result: new records appear in the detail block
/forum/fa/13292/0/

That would be all, I guess. Adjust it to your situation; I hope you'll make it work.
Re: Apex 5 Master Detail Form [message #656678 is a reply to message #656671] Fri, 14 October 2016 03:55 Go to previous messageGo to next message
knd.prasad
Messages: 35
Registered: December 2009
Location: HYDERABAD
Member


SELECT nvl(x.eanno,'0') eanno ,' ' fab_code,SALES_CD,SIZE_CD,nvl(D.FAB_TYPE,2) BLEND, D.MRP, D.BASIC_PRICE,D.BRAND_CD,X.QTY,X.GARMENT_TYPE_CD
FROM WH.WH_ORDER_CONF_DTL D, WH.WH_ORDER_CONF_HDR H, WH.WH_DCCUM_INVOICE_HDR J, WH.WH_MULTIPLE_ORDERSGROUP_HDR M, WH.WH_MULTIPLE_ORDERSGROUP_DTL M1,
WH.WH_COMMERCIAL_INVOICE_HDR N,WH.WH_SCAN_ORDCONF_DTL X
WHERE H.ORDERCONF_NO = D.ORDERCONF_NO
AND M.TRAN_NO = M1.TRAN_NO
AND M1.ORDER_NO = D.ORDER_NO
AND M1.ORDERCONF_NO = D.ORDERCONF_NO
AND D.ORDERCONF_NO=X.ORDERCONF_NO
AND D.MKTG_SALES_CD=X.MKTG_SALES_CD
AND M.TRAN_NO=N.ORDER_NO
AND H.CUST_ID=J.CUST_ID
and ((j.cedc_no= n.c_cedc_no) or (j.cedc_no= n.pc_cedc_no))
and j.cust_id=:p5_cust
AND M1.TRAN_NO = J.ORDER_NO
AND J.FIN_YEAR_CD = :p4_FIN_CD
AND J.FAB_TYPE = DECODE(D.FAB_TYPE, '1', 'COTTON', '2', 'NON COTTON')
AND COMM_INVOICE_NO=:p21_INV_NO



This is the query , if i run this i will get below data



EANNO FAB_CODE SALES_CD SIZE_CD BLEND MRP BPRICE BRAND QTY GARMENT
U2573 DFU1210629 42 1 1,899 1,153 2 1 1
U2513 DFU1210629 38 1 1,899 1,153 2 1 1
U1451 DFU1170313 46 1 2,099 1,274 2 1 1
U5320 DFU1210609 42 1 2,299 1,396 2 1 1
U5242 DFU1060371 42 1 2,099 1,274 2 1 1
U5219 DFU1060371 42 1 2,099 1,274 2 1 1
U3461 DFU1200926 42 2 1,899 1,153 2 1 1
U6591 DFU1170314 39 1 1,799 1,092 2 1 1
U5047 DFU1210610 44 1 2,299 1,396 2 1 1
U5410 DFU1200933 42 1 2,099 1,274 2 1 1
U5427 DFU1200933 44 1 2,099 1,274 2 1 1
U2435 DFU1210628 42 1 1,899 1,153 2 1 1



I want to fill this data in Detail region .


Thanks
prasad





Re: Apex 5 Master Detail Form [message #656690 is a reply to message #656678] Fri, 14 October 2016 08:02 Go to previous message
Littlefoot
Messages: 21823
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
Can you transform that SELECT statement into UPDATE? Should be quite simple.
Previous Topic: using a javascript variable with PL/SQL procedure
Next Topic: APEX 5 tabular Form, UNION AND ORA-01446
Goto Forum:
  


Current Time: Wed Dec 04 13:13:39 CST 2024