Skip to Main Content

APEX

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Adding Row numbers to an APEX Interactive Grid

trishlMay 22 2017 — edited May 23 2017

Hi,

Im on APEX 5.1 and Oracle 12 C.

I'm working with a 2 page master detail form. My detail form is an interactive grid (by default). I need to enter multiple rows in the detail and have them sequentially assigned a row number starting with 1. The unique field  on the master and detail is Sample_ID. So in the master table SAMPLE_ID is the PK and in the detail table the SAMPLE_ID and LINE_NUMBER are the PK.

In oracle forms I have something like this. I modified it for APEX and I have it in the default value for the item. It works great for the first row, but not the second.  Can you tell me how I might accomplish this. In the oracle form we force a save when navigating to the next record.

Declare line_number number;

Begin

Select nvl(max(line_no),0) + 1 into  line_number

From  SAM_LINES_AX@haasprod_link

Where sample_id = :P23_SAMPLE_ID;

Return  LINE_NUMBER;

End;

Thanks in advance.

Trish

This post has been answered by LA County APEX on May 23 2017
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jun 20 2017
Added on May 22 2017
2 comments
2,518 views