APEX 4 Tabular Form Collection

Hello everyone,
I have a Tabular Form on Collection (APEX 4). I only want to update the records that are checked, but it validates and updated all the records regarless of the checked records. How do I get this (page-to-collection) to only update the selected records. Any help is greatly appreciated.
This is my table-to-collection:
DECLARE
l_collection_name VARCHAR2(50);
l_query VARCHAR2(32767);
BEGIN
l_collection_name := 'WORK_TABLE';
IF apex_collection.collection_exists(l_collection_name)
THEN
apex_collection.delete_collection(
p_collection_name => l_collection_name);
END IF;
l_query := 'select seq_no,' -- c001 => f01
|| ' fk_paygrade, ' -- c002 => f02
|| ' annual_hour, ' -- c003 => f03
|| ' A1, ' -- c004 => f04
|| ' A2, ' -- c005 => f05
|| ' A3, ' -- c006 => f06
|| ' A4, ' -- c007 => f07
|| ' A5, ' -- c008 => f08
|| ' A6, ' -- c009 => f09
|| ' A7, ' -- c010 => f10
|| ' A8, ' -- c011 => f11
|| ' A9, ' -- c012 => f12
|| ' A10, ' -- c013 => f13
|| ' A11, ' -- c014 => f14
|| ' A12, ' -- c015 => f15
|| ' A13, ' -- c016 => f16
|| ' A14, ' -- c017 => f17
|| ' H1, ' -- c018 => f18
|| ' H2, ' -- c019 => f19
|| ' H3, ' -- c020 => f20
|| ' H4, ' -- c021 => f21
|| ' H5, ' -- c022 => f22
|| ' H6, ' -- c023 => f23
|| ' H7, ' -- c024 => f24
|| ' H8, ' -- c025 => f25
|| ' H9, ' -- c026 => f26
|| ' H10, ' -- c027 => f27
|| ' H11, ' -- c028 => f28
|| ' H12, ' -- c029 => f29
|| ' H13, ' -- c030 => f30
|| ' H14, ' -- c031 => f31
|| ' NULL, ' --c032 => f32
|| ' NULL, ' --c033 => f33
|| ' NULL, ' --c034 => f34
|| ' NULL, ' --c035 => f35 
|| ' NULL, ' --c036 => f36  
|| ' NULL, ' --c037 => f37  
|| ' NULL, ' --c038 => f38 
|| ' NULL, ' --c039 => f39  
|| ' NULL, ' --c040 => f40  
|| ' NULL, ' --c041 => f41 
|| ' NULL, ' --c042 => f42  
|| ' NULL, ' --c043 => f43 
|| ' NULL, ' --c044 => f44  
|| ' NULL, ' --c045 => f45 
|| ' NULL, ' --c046 => f46
|| ' ''O'', ' --c047 => f47 
|| ' wwv_flow_item.md5(seq_no, fk_paygrade, annual_hour, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, H1, H2, H3, H4, H5, H6, H7, H8, H9, H10, H11, H12, H13, H14) ' -- c048
|| 'from paygrade_increase ';
apex_collection.create_collection_from_query_b(
p_collection_name => l_collection_name,
p_query => l_query);
IF :REQUEST = 'ADD'
THEN
apex_collection.add_member(
p_collection_name => l_collection_name
END IF;
END;
From collection-to-tabular-form report:
SELECT APEX_ITEM.HIDDEN(47,c047,NULL,'f47_'|| '#ROWNUM#')
|| APEX_ITEM.HIDDEN(48,c048,NULL,'f48_'|| '#ROWNUM#')
|| APEX_ITEM.HIDDEN(49,seq_id,NULL,'f49_'|| '#ROWNUM#')
|| APEX_ITEM.HIDDEN(1,c001,NULL,'f01_'|| '#ROWNUM#')
|| APEX_ITEM.CHECKBOX(
50,
seq_id,
NULL,
CASE
WHEN c047 = 'U' THEN seq_id
END,
'f50_' || '#ROWNUM#'
) AS update_checkbox,
APEX_ITEM.TEXT(
2,
c002,
20,
50,
NULL,
'f02_' || '#ROWNUM#'
) as fk_paygrade,
APEX_ITEM.TEXT(
3,
c003,
20,
50,
NULL,
'f03_' || '#ROWNUM#'
) AS annual_hour,
APEX_ITEM.TEXT(
4,
c004,
20,
50,
NULL,
'f04_' || '#ROWNUM#'
) AS A1,
APEX_ITEM.TEXT(
5,
c005,
20,
50,
NULL,
'f05_' || '#ROWNUM#'
) AS A2,
APEX_ITEM.TEXT(
6,
c006,
20,
50,
NULL,
'f06_' || '#ROWNUM#'
) AS A3,
APEX_ITEM.TEXT(
7,
c007,
20,
50,
NULL,
'f07_' || '#ROWNUM#'
) AS A4,
APEX_ITEM.TEXT(
8,
c008,
20,
50,
NULL,
'f08_' || '#ROWNUM#'
) AS A5,
APEX_ITEM.TEXT(
9,
c009,
20,
50,
NULL,
'f09_' || '#ROWNUM#'
) AS A6,
APEX_ITEM.TEXT(
10,
c010,
20,
50,
NULL,
'f10_' || '#ROWNUM#'
) AS A7,
APEX_ITEM.TEXT(
11,
c011,
20,
50,
NULL,
'f11_' || '#ROWNUM#'
) AS A8,
apex_item.text(
12,
c012,
20,
50,
NULL,
'f12_' || '#ROWNUM#'
) AS A9,
apex_item.text(
13,
c013,
20,
50,
NULL,
'f13_' || '#ROWNUM#'
) AS A10,
apex_item.text(
14,
c014,
20,
50,
NULL,
'f14_' || '#ROWNUM#'
) AS A11,
apex_item.text(
15,
c015,
20,
50,
NULL,
'f15_' || '#ROWNUM#'
) AS A12,
apex_item.text(
16,
c016,
20,
50,
NULL,
'f16_' || '#ROWNUM#'
) AS A13,
apex_item.text(
17,
c017,
20,
50,
NULL,
'f17_' || '#ROWNUM#'
) AS A14,
APEX_ITEM.TEXT(
18,
c018,
20,
50,
NULL,
'f18_' || '#ROWNUM#'
) as H1,
APEX_ITEM.TEXT(
19,
c019,
20,
50,
NULL,
'f19_' || '#ROWNUM#'
) as H2,
APEX_ITEM.TEXT(
20,
c020,
20,
50,
NULL,
'f20_' || '#ROWNUM#'
) as H3,
APEX_ITEM.TEXT(
21,
c021,
20,
50,
NULL,
'f21_' || '#ROWNUM#'
) as H4,
APEX_ITEM.TEXT(
22,
c022,
20,
50,
NULL,
'f22_' || '#ROWNUM#'
) as H5,
APEX_ITEM.TEXT(
23,
c023,
20,
50,
NULL,
'f23_' || '#ROWNUM#'
) as H6,
APEX_ITEM.TEXT(
24,
c024,
20,
50,
NULL,
'f24_' || '#ROWNUM#'
) as H7,
APEX_ITEM.TEXT(
25,
c025,
20,
50,
NULL,
'f25_' || '#ROWNUM#'
) as H8,
APEX_ITEM.TEXT(
26,
c026,
20,
50,
NULL,
'f26_' || '#ROWNUM#'
) as H9,
APEX_ITEM.TEXT(
27,
c027,
20,
50,
NULL,
'f27_' || '#ROWNUM#'
) as H10,
APEX_ITEM.TEXT(
28,
c028,
20,
50,
NULL,
'f28_' || '#ROWNUM#'
) as H11,
APEX_ITEM.TEXT(
29,
c029,
20,
50,
NULL,
'f29_' || '#ROWNUM#'
) as H12,
APEX_ITEM.TEXT(
30,
c030,
20,
50,
NULL,
'f30_' || '#ROWNUM#'
) as H13,
APEX_ITEM.TEXT(
31,
c031,
20,
50,
NULL,
'f31_' || '#ROWNUM#'
) as H14
FROM apex_collections
WHERE collection_name = 'WORK_TABLE'
Page-to-collection:
DECLARE
l_collection_name APEX_COLLECTIONS.COLLECTION_NAME%TYPE;
l_original_md5 VARCHAR2(3000);
l_latest_md5 VARCHAR2(3000);
BEGIN
l_collection_name := 'WORK_TABLE';
FOR x IN 1 .. apex_application.g_f49.count
LOOP
IF apex_application.g_f01(x) IS NOT NULL --ID exists, check to see if record was updated
THEN
SELECT c048
INTO l_original_md5
FROM apex_collections
WHERE collection_name = l_collection_name
AND seq_id = apex_application.g_f49(x);
l_latest_md5 := wwv_flow_item.md5(
apex_application.g_f01(x),
apex_application.g_f02(x),
apex_application.g_f03(x),
apex_application.g_f04(x),
apex_application.g_f05(x),
apex_application.g_f06(x),
apex_application.g_f07(x),
apex_application.g_f08(x),
apex_application.g_f09(x),
apex_application.g_f10(x),
apex_application.g_f11(x),
apex_application.g_f12(x),
apex_application.g_f13(x),
apex_application.g_f14(x),
apex_application.g_f15(x),
apex_application.g_f16(x),
apex_application.g_f17(x),
apex_application.g_f18(x),
apex_application.g_f19(x),
apex_application.g_f20(x),
apex_application.g_f21(x),
apex_application.g_f22(x),
apex_application.g_f23(x),
apex_application.g_f24(x),
apex_application.g_f25(x),
apex_application.g_f26(x),
apex_application.g_f27(x),
apex_application.g_f28(x),
apex_application.g_f29(x),
apex_application.g_f30(x),
apex_application.g_f31(x)
IF l_original_md5 != l_latest_md5
THEN
apex_collection.update_member(
p_collection_name => l_collection_name,
p_seq => apex_application.g_f49(x),
p_c001 => apex_application.g_f01(x),
p_c002 => apex_application.g_f02(x),
p_c003 => apex_application.g_f03(x),
p_c004 => apex_application.g_f04(x),
p_c005 => apex_application.g_f05(x),
p_c006 => apex_application.g_f06(x),
p_c007 => apex_application.g_f07(x),
p_c008 => apex_application.g_f08(x),
p_c009 => apex_application.g_f09(x),
p_c010 => apex_application.g_f10(x),
p_c011 => apex_application.g_f11(x),
p_c012 => apex_application.g_f12(x),
p_c013 => apex_application.g_f13(x),
p_c014 => apex_application.g_f14(x),
p_c015 => apex_application.g_f15(x),
p_c016 => apex_application.g_f16(x),
p_c017 => apex_application.g_f17(x),
p_c018 => apex_application.g_f18(x),
p_c019 => apex_application.g_f19(x),
p_c020 => apex_application.g_f20(x),
p_c021 => apex_application.g_f21(x),
p_c022 => apex_application.g_f22(x),
p_c023 => apex_application.g_f23(x),
p_c024 => apex_application.g_f24(x),
p_c025 => apex_application.g_f25(x),
p_c026 => apex_application.g_f26(x),
p_c027 => apex_application.g_f27(x),
p_c028 => apex_application.g_f28(x),
p_c029 => apex_application.g_f29(x),
p_c030 => apex_application.g_f30(x),
p_c031 => apex_application.g_f31(x),
p_c047 => 'U',
p_c048 => apex_application.g_f48(x)
END IF;
ELSE --ID does not exist, must be new record
apex_collection.update_member(
p_collection_name => l_collection_name,
p_seq => apex_application.g_f49(x),
p_c001 => apex_application.g_f01(x),
p_c002 => apex_application.g_f02(x),
p_c003 => apex_application.g_f03(x),
p_c004 => apex_application.g_f04(x),
p_c005 => apex_application.g_f05(x),
p_c006 => apex_application.g_f06(x),
p_c007 => apex_application.g_f07(x),
p_c008 => apex_application.g_f08(x),
p_c009 => apex_application.g_f09(x),
p_c010 => apex_application.g_f10(x),
p_c011 => apex_application.g_f11(x),
p_c012 => apex_application.g_f12(x),
p_c013 => apex_application.g_f13(x),
p_c014 => apex_application.g_f14(x),
p_c015 => apex_application.g_f15(x),
p_c016 => apex_application.g_f16(x),
p_c017 => apex_application.g_f17(x),
p_c018 => apex_application.g_f18(x),
p_c019 => apex_application.g_f19(x),
p_c020 => apex_application.g_f20(x),
p_c021 => apex_application.g_f21(x),
p_c022 => apex_application.g_f22(x),
p_c023 => apex_application.g_f23(x),
p_c024 => apex_application.g_f24(x),
p_c025 => apex_application.g_f25(x),
p_c026 => apex_application.g_f26(x),
p_c027 => apex_application.g_f27(x),
p_c028 => apex_application.g_f28(x),
p_c029 => apex_application.g_f29(x),
p_c030 => apex_application.g_f30(x),
p_c031 => apex_application.g_f31(x),
p_c047 => 'N',
p_c048 => apex_application.g_f48(x)
END IF;
END LOOP;
IF :REQUEST = 'DELETE'
THEN
FOR x IN 1 .. apex_application.g_f50.count
LOOP
apex_collection.update_member_attribute(
p_collection_name => l_collection_name,
p_seq => apex_application.g_f50(x),
p_attr_number => '47',
p_attr_value => 'D'
END LOOP;
END IF;
END;
Collection-to-table
DECLARE
l_table_md5 VARCHAR2(32);
l_collection_name APEX_COLLECTIONS.COLLECTION_NAME%TYPE;
l_del_count PLS_INTEGER := 0;
l_upd_count PLS_INTEGER := 0;
l_ins_count PLS_INTEGER := 0;
l_success_message VARCHAR2(32767);
CURSOR op_lock_check_cur (p_id IN NUMBER)
IS
SELECT wwv_flow_item.md5(seq_no, fk_paygrade, annual_hour, a1, a2, a3, a4, a5, a6, a7, a8,
a9, a10, a11, a12, a13, a14, h1, h2, h3, h4, h5, h6, h7, h8, h9,
h10, h11, h12, h13, h14)
FROM paygrade_increase
WHERE seq_no = op_lock_check_cur.p_id
FOR UPDATE;
BEGIN
l_collection_name := 'WORK_TABLE';
FOR x IN (
SELECT *
FROM apex_collections
WHERE collection_name = l_collection_name
AND c047 IN ('N','U','D')
LOOP
IF x.c047 = 'N'
THEN
INSERT INTO PAYGRADE_INCREASE(
seq_no,
fk_paygrade,
annual_hour,
a1,
a2,
a3,
a4,
a5,
a6,
a7,
a8,
a9,
a10,
a11,
a12,
a13,
a14,
h1,
h2,
h3,
h4,
h5,
h6,
h7,
h8,
h9,
h10,
h11,
h12,
h13,
h14
) VALUES (
users_seq.nextval,
x.c002,
x.c003,
x.c004,
x.c005,
x.c006,
x.c007,
x.c008,
x.c009,
x.c010,
x.c011,
x.c012,
x.c013,
x.c014,
x.c015,
x.c016,
x.c017,
x.c018,
x.c019,
x.c020,
x.c021,
x.c022,
x.c023,
x.c024,
x.c025,
x.c026,
x.c027,
x.c028,
x.c029,
x.c030,
x.c031
l_ins_count := l_ins_count + 1;
ELSIF x.c047 = 'U'
THEN
--Optimistic lock check
--MD5 should be identical to collection initialization proc
OPEN op_lock_check_cur(x.c001);
FETCH op_lock_check_cur INTO l_table_md5;
-- Compare the checksum values and if they are different, raise an error.
IF l_table_md5 != x.c048
THEN
raise_application_error(
-20001,
'Current version of data in database has changed '
|| 'since user initiated update process.'
END IF;
UPDATE paygrade_increase
SET fk_paygrade = x.c002,
annual_hour = x.c003,
a1 = x.c004,
a2 = x.c005,
a3 = x.c006,
a4 = x.c007,
a5 = x.c008,
a6 = x.c009,
a7 = x.c010,
a8 = x.c011,
a9 = x.c012,
a10 = x.c013,
a11 = x.c014,
a12 = x.c015,
a13 = x.c016,
a14 = x.c017,
h1 = x.c018,
h2 = x.c019,
h3 = x.c020,
h4 = x.c021,
h5 = x.c022,
h6 = x.c023,
h7 = x.c024,
h8 = x.c025,
h9 = x.c026,
h10 = x.c027,
h11 = x.c028,
h12 = x.c029,
h13 = x.c030,
h14 = x.c031
WHERE CURRENT OF op_lock_check_cur;
CLOSE op_lock_check_cur;
l_upd_count := l_upd_count + 1;
ELSIF x.c047 = 'D'
THEN
DELETE FROM paygrade_increase
WHERE seq_no = x.c001;
l_del_count := l_del_count + 1;
END IF;
END LOOP;
apex_collection.delete_collection(p_collection_name => l_collection_name);
l_success_message :=
l_ins_count || ' rows inserted, ' ||
l_upd_count || ' rows updated, ' ||
l_del_count || ' rows deleted';
:PX_SUCCESS_MESSAGE := l_success_message;
END;
Thank you so much,
MT

Hi,
You need to modify your "Page-to-collection:" code so that you mark the collection member c047 as updated (U) only if that particular row's checkbox was checked. Given the fact that the checkbox APEX_APPLICATION global variable holds only checked values, you need to loop through the checkbox variable for every row to determine if the checkbox was checked.
Here is the pseudocode:
-- Your "Page-to-collection:" code
-- continues until this below line...
IF l_original_md5 != l_latest_md5
THEN
   -- additional check: mark collection member
   -- as updated only if checkbox is checked
   -- Loop through checked values array
   -- to see if the current row checkbox was checked
   FOR y IN 1 .. apex_application.g_f50.count
   LOOP
      -- compare SEQ_ID stored in hidden item (f49)
      -- against SEQ_ID stored in checkbox (f50)
       IF apex_application.g_f49(x) = apex_application.g_f50(y)
       THEN
         apex_collection.update_member(
         p_collection_name => l_collection_name,
         p_seq => apex_application.g_f49(x),
         p_c001 => apex_application.g_f01(x),
         p_c002 => apex_application.g_f02(x),
         p_c003 => apex_application.g_f03(x),
         p_c004 => apex_application.g_f04(x),
         p_c005 => apex_application.g_f05(x),
         p_c006 => apex_application.g_f06(x),
         p_c007 => apex_application.g_f07(x),
         p_c008 => apex_application.g_f08(x),
         p_c009 => apex_application.g_f09(x),
         p_c010 => apex_application.g_f10(x),
         p_c011 => apex_application.g_f11(x),
         p_c012 => apex_application.g_f12(x),
         p_c013 => apex_application.g_f13(x),
         p_c014 => apex_application.g_f14(x),
         p_c015 => apex_application.g_f15(x),
         p_c016 => apex_application.g_f16(x),
         p_c017 => apex_application.g_f17(x),
         p_c018 => apex_application.g_f18(x),
         p_c019 => apex_application.g_f19(x),
         p_c020 => apex_application.g_f20(x),
         p_c021 => apex_application.g_f21(x),
         p_c022 => apex_application.g_f22(x),
         p_c023 => apex_application.g_f23(x),
         p_c024 => apex_application.g_f24(x),
         p_c025 => apex_application.g_f25(x),
         p_c026 => apex_application.g_f26(x),
         p_c027 => apex_application.g_f27(x),
         p_c028 => apex_application.g_f28(x),
         p_c029 => apex_application.g_f29(x),
         p_c030 => apex_application.g_f30(x),
         p_c031 => apex_application.g_f31(x),
         p_c047 => 'U',
         p_c048 => apex_application.g_f48(x)
       END IF;
   END LOOP; -- end checkbox loop
END IF; -- end UPDATE check
ELSE --ID does not exist, must be new record
-- rest of the code for "Page-to-collection:"
--Thanks!
JMcG

Similar Messages

  • Second LOV based on First LOV in Oracle APEX tabular Form

    Hi,
    I had created a tabular form in which I am having two LOV's. This form is based on a query.
    I had created a javascript function which internally calls AJAX and populates the second LOV based on the value selected in first LOV when onchange.
    But the issue is, when the user recalls this APEX page to view the details or edit the details, the second LOV shows all the values instead of showing only the values related to first LOV.
    In the second LOV query I am trying to write the below query.
    select function_name fn
    ,function_code_id fci
    from catering_function_codes
    where function_type_id = NVL(#FUNCTION_TYPE_ID#,function_type_id)
    order by to_number(function_code_id)
    in which #FUNCTION_TYPE_ID# is the value of first LOV. But I am getting the below error.
    report error:
    ORA-20001: Error fetching column value: ORA-06550: line 1, column 187:
    PL/SQL: ORA-00911: invalid character
    ORA-06550: line 1, column 7:
    PL/SQL: SQL Statement ignored
    How can you refer to the Second LOV the value of First LOV in a report based tabular form?
    Kindly let me know if you do not understand the issue.
    Please help me in this issue.
    Thank you
    Regards
    Dev

    Hi Roel,
    Thank you for the quick reply.
    I used the query as given by you. This time it is not giving any error but showing all the values in the second LOV irrespective of what ever value is present in the first LOV
    This is an apex tabular form which is generated by apex based on a query. The controls will be dynamically generated by APEX for each row. How can we hard code the control name to :P99_FUNCTION_TYPE_ID?
    Please help me in this issue. Thank you
    Regards
    Dev

  • Apex, Tabular forms and Nested Tables := Headache

    Hi All,
    I'm constructing an Apex aplication for Performance Reviewing staff and I have need of nested tables within each line item for ongoing comments during the year, the headings of which are drawn from another table, based on a template for which ones are to be used at any given time.
    I'd like to be able to use a tabular form to draw out the history of comments at any given time and modify them however I'm at a complete loss as to how to get this working with a tabular form in Apex. If anyone could point me at some good documentation on the subject or even suggest a better method to get this done I'd be very grateful.
    Thanks!

    Hi,
    Take a look at this article:
    http://www.oracle-base.com/articles/misc/ObjectViewsAndNestedTables.php
    First, create a view as described on your nested and other table(s), with 'Instead Of' triggers handling the DML. Next create the tabular form based on the view. You'll find many posts in the forum regarding building a tablular form based on a view.
    Paul Brookes.

  • Row level cascading in Apex tabular form

    Hi,
    I have searched alot,but i am not able to find the solution
    I have a tabular form and  having only one column say column A is dynamic LOV (Select col1 from lov_table will return values as 1,2,3........)
      When user press ADD ROW button
    row 1 => column A display LOV as _1,2,3.... then if user selects  1
    When user press ADD ROW button
    row 2 => column A "should" display LOV as 2,3,.....
    Anyone could help me out to solve this problem......
    Regards,
    Venkat

    Hi,
    steps i followed:---
    i created a dynamic action
    event--- change
    select type --jquery selector
    jquery selector--[name="f05"]
    action--Execute PL/SQL Code
    script---
    DECLARE
      V_COLLECTION_NAME VARCHAR2 (30) := 'XXBCT_GPMS_COL';
      V_ITEM_ID         NUMBER;
      L_SEQ_ID          NUMBER;
      L_ITEM_VALUE      NUMBER;
    BEGIN
      IF NOT apex_collection.collection_exists (p_collection_name => v_collection_name) THEN
        APEX_COLLECTION.CREATE_OR_TRUNCATE_COLLECTION (P_COLLECTION_NAME => V_COLLECTION_NAME);
      END IF;
      V_ITEM_ID := (APEX_APPLICATION.G_X01);
      SELECT MIN(seq_id)
      INTO L_SEQ_ID
      FROM APEX_COLLECTIONS
      WHERE COLLECTION_NAME = V_COLLECTION_NAME;
      IF L_SEQ_ID          IS NULL THEN
        APEX_COLLECTION.ADD_MEMBER ( P_COLLECTION_NAME => V_COLLECTION_NAME, P_C001 => V_ITEM_ID );
      END IF;
      FOR i IN 1..apex_application.g_f05.count
      LOOP
        SELECT SEQ_ID,
          C001
        INTO L_SEQ_ID,
          L_ITEM_VALUE
        FROM APEX_COLLECTIONS
        WHERE COLLECTION_NAME =V_COLLECTION_NAME;
        IF L_ITEM_VALUE      !=V_ITEM_ID THEN
          APEX_COLLECTION.ADD_MEMBER ( P_COLLECTION_NAME => V_COLLECTION_NAME, P_C001 => V_ITEM_ID );
        ELSE
          APEX_COLLECTION.UPDATE_MEMBER ( P_COLLECTION_NAME => V_COLLECTION_NAME, P_SEQ => L_SEQ_ID, P_C001 => V_ITEM_ID);
        END IF;
      END LOOP;
    END;
    affected elements-->no
    event scope--dynamic
    --->for tat tabular form column
    SELECT DISTINCT msib.DESCRIPTION,
      msib.INVENTORY_ITEM_ID
    FROM MTL_SYSTEM_ITEMS_B MSIB,
      ORG_ORGANIZATION_DEFINITIONS OOD
    WHERE MSIB.ORGANIZATION_ID      =OOD.ORGANIZATION_ID
    AND OOD.BUSINESS_GROUP_ID       =FND_PROFILE.VALUE('PER_BUSINESS_GROUP_ID')
    AND MSIB.INVENTORY_ITEM_ID NOT IN
      (SELECT AC.C001
      FROM APEX_COLLECTIONS AC
      WHERE AC.COLLECTION_NAME ='XXBCT_GPMS_COL'
    ORDER BY msib.INVENTORY_ITEM_ID
    but this script is not working ...
    collection itself not creating i don't know y..
    kindly help me to solve this problem....................
    Thanks,
    Venkat

  • Insert and update in database using apex tabular form

    Hi All,
    i have tabular form
    category_ID
    Day
    Hours
    Start Date
    End Date
    1001
    2
    3
    01-jun-2013
    Null
    1002
    1
    4
    02-jun-2013
    Null
    1003
    2
    5
    03-jun-2013
    null
    if day or hour change/update then End date will be sysdate.
    and new row insert in table
    category_ID
    Day
    Hours
    Start Date
    End Date
    Header 6
    1001
    1
    3
    01-jun-2013
    04-jun-2013
    Day change from 2 to 1
    1002
    1
    4
    02-jun-2013
    Null
    No change
    1003
    2
    5
    03-jun-2013
    null
    No change
    1001
    1
    3
    04-jun-2013
    null
    New record insert which is change/update
    how to achieve it.
    Thanks in advance,
    Prashant

    I usualy don't use the apex wizards to create forms when you need such custom functionality.
    I just make the needed items, and when saving the form elements to the db i run my own written procedure en i submit the page with the request 'UPDATE' and i also set an id item with the newly created id for the inserted record.
    So the page knows it should call the procedure that fills up all items with the values of the record i just saved. this also comes in handy when inserting a form in multiple tables.

  • APEX tabular form update recognition

    Dear all,
    I am quite new to APEX so please apologize if I am asking "stupid" questions. Unfortunately, the information I was able to find up to now was only partially helpful. Apparently I must be missing something obvious. The APEX version I use is 4.0.1.
    When submitting a page that contains a tabular form, I need to find out, which record has been created or updated in order to fill in additional information automatically, e.g. logging data (created, last updated, ...). I cannot do this in a trigger, because the trigger sees only APEX_PUBLIC_USER and does not know about the "real" user who has connected to the database. If there is a better or easier way to do this, please let me know.
    My problem is to find out, if a new record has been added by clicking the "add row" button and / or if an existing record has been modified, because creation and modification have to be handled differently. Existing and unmodified records in the table must not be touched. I can access the columns by using APEX_APPLICATION.G_Fxx() but how do I recognize modifications? In a thread in this forum I found information about using a MD5 checksum. So I have added a checksum field using APEX_ITEM.MD5_HIDDEN() and tried to check this information. Unfortunately, doing this, I already get a problem when I submit the page after having added an empty record by clicking on "add row" but without having supplied any information. APEX then complains about information that has been modified in the meantime instead of just ignoring the empty record. This is probably because APEX considers the record as changed because of the checksum column I have added (I have read that the SQL query to create the tabular form must not be altered).
    Could anybody please show me the right way to do such a check?
    Thank you very much for your help.
    Best regards,
    Ralf Gorholt

    Hi Ralph,
    Well, if you are wanting to check if anything has been updated before the update button is pressed, using JS, you can use the property of the field 'defaultValue' and compare it to the property 'value'
    i.e. for the text input type
    function isElementChanged( myElement ) {
      var iselementChanged = false;
      var returnVal = false;
      switch ( myElement.type ) {
      case "text" :
        if ( myElement.value != myElement.defaultValue )
          return true;
        break;
    default
         return false;
    }  You could cycle through all elements, by:
    allEls = form.elements;
    for (i=0; i < allEls.length; i++){
      if ( allEls.type != undefined && allEls[i].type.length > 0 && allEls[i].disabled == false ) {
    if (isElementChanged(allElls[i])) {
    //TODO: logic here
    }Ta,<br />Trent                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

  • ORDS v3 and APEX tabular form issue

    Hi,
    We encountered strange issue after installing ORDS v3 EA to test, thought I would report this. I'm not sure if its a bug but it seems to be reproducible in our instance.
    Steps:
    1) Install ORDS v3 with Glassfish deployment.
    2) Go to APEX builder -> Page with report (classic or interactive) -> Edit Attributes -> Change data in column attempt to save throws out "ORA-01403: no data found"
    or
    3) Create APEX app -> Build page with DML form and Tabular form -> Edit tabular form attempt to save throws out same error.
    Application error logs shows:
    ORA-20987: APEX - Unable to change column attributes. - ORA-01403: no data found
    WWV_FLOW_SECURITY
    FINAL_EXCEPTION_HANDLER
    Also, I was unable to get RESTFul services working with APEX no matter how I configured ORDS v3. I don't encounter these issues when reverting back to version 1.x , 2.x
    APEX Version: 4.2.6.00.03
    Oracle DB: 11.2.0.3.0
    Glassfish : open source edition 4.1
    Regards,
    -Senthil

    I too am getting ORA-01403 both when trying to save in the builder and when just hitting submit on the tabular form when using standalone EA3. Happens when pointing at 4.1 or 4.2.6. The v2 listeners works fine when pointing to the same applications/pages.
    I asked oracle support whether it is a known EA3 issue but was told to add my observations to the forum.
    cheers
    ~t

  • APEX - tabular form update

    Hey guys,
    as per client's request, we need to insert rows into db from tabular form even there is no change on the new row. db table is configured to have nullable fields.
    Currently, it won't allow me to do so. Is there any way to force the insert/update without checking if the information on the row is updated?
    Thanks a lot

    You can do it, using manular tabular form.
    When you use automated Tabular Forms, it checks inbuilt global variables, to see row is updated or any new row is created and all necessary fields are keyed in.
    If you don't update an existing row, that row will not be updated..
    If you create/add new empty row and don't key in values, that row will not be inserted as there is no data..
    If you want to do in that manner, make your MRU process on the page to never and write your own manual MRU

  • Validate field in tabular forms apex 4.2

    Hi.
    i need help doing next validations :
    1.- i have a product_item field (wich is a lov and user choose one value), so i need to call a function (sending it the selected value product_item) that will return me some data about the product i selected, for example :
    if the function return 'A' then
    disable the next item on tabular form, lets say quantity
    else
    enable the next item on tabular form, lets say quantity
    end if
    2.- i need to determine the result of two items operations:
    total := final_quantity - start_quantity
    the user will introduce start and final quantity and i will determine the total.
    any ideas ?
    i am new on apex and need to do this on tabular forms.
    thanks in advance.

    Thomas,
    Is this a standard APEX tabular form validation, or a custom PL/SQL based validation? It might be easiest to diagnose what's going on there, if you could replicate this issue on apex.oracle.com, and point us to an example.
    Thanks,
    Marc

  • Validation problem on tabular form APEX 4.2

    Hi,
    My APEX Version is 4.2.
    I have problem with validations on tabular forms, for example : I have a column who must be numeric... when I get a character it is controlled properly, but it removes my line of the screen and he writes in the table below:
    state error:
    ORA-01403: no data found
    ORA-06510: PL / SQL: exception defined by the user untreated
    I Haven't this problem with this application on APEX 4.0
    PS : the validation was automatically create by APEX
    Regards

    Thomas,
    Is this a standard APEX tabular form validation, or a custom PL/SQL based validation? It might be easiest to diagnose what's going on there, if you could replicate this issue on apex.oracle.com, and point us to an example.
    Thanks,
    Marc

  • TABULAR FORM UPDATE ERROR CURRENT VERSION OF DATA IN DB HAS CHANGED...!

    Hi all Experts on Apex 423 and Oracle xe 11g r2...
    I'm getting a systematic error when updating a Apex Tabular form : the Oracle internal engine complaining that the row ID's are out of syncr?  I'm use ROWID instead of ID  ( trigger has been created but I think should not used ...!)
    Any advise.
    remark:  The  SIMPLE DATA APPLICATION has the same issue when trying to update the QUANTITY field on ORDERS... STRANGE NOT?
    MFOConsulting  Switzerland
    [email protected]

    Hi All Apex Experts,
    Détails  with Détails records  in a TABULAR FORM .
    I tranformed this program Master-Détails with Détails records  in FORM ( not tabular)  and this  error message is no more displayed on the screen.!!
    CONCLUSION:   there is a   SERIUOS  BUG in Apex 423.00.08   and 424.00.008!!
    I hope that People in Oracle Corporation is  working on this bug. and the next release of  Apex 5.0 will correct it.
    PS:   The SIMPLE DATA BASE installed   with any version of Apex... display this MSg .( update ORDERS  quantity of items and you recieve thiS fanny message!
    MFOConsulting Switzerland

  • Tabular form Update Error,"Current version of data in database has changed

    I'm getting an error when updating a Apex Tabular form. It's complaining that the row id's are out-of-sync. The error reads,' Current version of data in database has changed since user initiated update process. current row version identifier = "56DW5A8A7EBA3B42073AE6E71480A784" application row version identifier = "99B52A15F10E34647E9E18B6B7AE8C30" .
    Has anyone received this error? Any solutions? Note that the primary is being populated by a trigger. I have another tabular form for a different application that updates without issue, this however, uses a sequence to update the primary key.
    Thanks,
    James

    Make sure that the form is defined such that it "knows" that the PK is being set by a trigger. Do not try to set it in the form if the trigger is doing it. Pretty much if a trigger attempt to modify any column that also was editable (including hidden columns) in the form, the two will conflict.
    The other issue could be that do you have any items on the rows that are disabled? Disabled items are not sent to session state so Apex won't be able to properly compute the checksum and it'll find a discrepancy.

  • Tabular form problems

    I have created a default APEX tabular form. Also this page has another form region with some updatable fields. The first region contains the updatable form and second region contains a few editable fields and links.
    I have a wide report and user has to scroll to check appropriate row check box for updating. is there way to automatically check the row selection box, whenever user makes a change to any field in that row and update only those rows with checked boxes?.
    Sometimes, the user makes some changes in the updatable form (first region) and makes changes to some fields in second region. The user would like to update the second region only (by a submit button) without resetting the values in the first region.
    any ideas are appreciated.
    thanks,
    Surya

    thanks Denes for your help, found your post useful as always.
    First question comments:
    I would like to have check box selected whenever the user changes a particular row. The reason is the update form has just too many rows and columns, and sometimes the user scrolls to the extreme right and update some fields there. When the user scrolls to exterme right, I provide duplicate read only column information ( like project number and name on both sides of the form) on the right side also for user to figure out which row he is interested in updating. It would be sometimes difficult for the user to check the exact on left side check box for update. I thought automatic update of checkbox with some "onChange" event might make user life easy and less error prone, as he doesn't have worry about checking the boxes explicitly by scrolling the form left and right.
    Second question comments:
    I tried some of the AJAX stuff you suggested. The field changes can be AJAX, but when the form in the bottom region is submitted, the whole page is submitted, which wipes out the changes (if any) in top updatable form. is there way I can save those those updatable form changes to a temporary buffer and refresh them eventhough the bottom region is submitted?
    Denes - I have sent a mail requesting you provide access to your workspace lastweek. could you please grant access to your workspace?. I really appreciate your help.
    thanks for your help,
    Surya

  • Question about Break Columns on Tabular Form

    is it possible to have the following result on apex Tabular Form while doing Break Columns ??
    To place one blank line between departments, enter the following command:
    BREAK ON DEPARTMENT_ID SKIP 1
    Now rerun the query:
    DEPARTMENT_ID LAST_NAME                     SALARY
               20 Hartstein                      13000
               80 Russell                        14000
                  Partners                       13500
               90 King                           24000
                  Kochhar                        17000
                  De Haan                        17000
    6 rows selected.The result achieved was not as expected, the sample is hosted on https://apex.oracle.com/pls/apex/f?p=10037 demo/1234 please help
    Region Source :
    select DEPTNO, EMPNO, ENAME, JOB,MGR, HIREDATE, SAL,COMM
    from "#OWNER#"."EMP"Report Attributes :
    Break Columns - First Column

    LTaura wrote:
    what does the built-in tabular form and break functionality do ?The built-in tabular form wizard generates the tabular form report and ApplyMRU and ApplyMRD processes to handle the submitted form.
    The report renders the retrieved data values as HTML form controls to enable them to be edited by the user. The <tt>DEPTNO</tt> in from the first row in your query is rendered thus:
    &lt;input type="text" name="f01" size="16" maxlength="2000" value="10" id="f01_0001" autocomplete="off"&gt;and that in the second row as:
    &lt;input type="text" name="f01" size="16" maxlength="2000" value="10" id="f01_0002" autocomplete="off"&gt;Since these are not exactly the same (different <tt>id</tt> attributes), the built-in break formatting sees them as different values, so no report break is applied.
    However, even if this was not the case and the break was applied to give only 3 text items for the 3 <tt>DEPTNO</tt> values, the ApplyMRU and ApplyMRD processes expect a <tt>DEPTNO</tt> value to be submitted for each row, and would fail for the subordinate <tt>EMP</tt> rows where it was missing.

  • Manual Tabular Form - Items not rendered

    Hi,
    i'm trying to build a manual tabular form:
    I added a blnak page with a Report Region using a SQL Query in a Classic Report:
    select      apex_item.text(1,"EMPNO") as "EMPNO",
    apex_item.text(2,"ENAME") as "ENAME",
    apex_item.text(3,"JOB") as "JOB",
    apex_item.text(4,"MGR") as "MGR",
    apex_item.text(5,"HIREDATE") as "HIREDATE"
    from      "EMP" "EMP"The items are not rendered in the report, but the HTML Text is displayed instead.
    See http://tinypic.com/r/2e6bqdu/5
    I played around with "Display As" in the Column Attributes - no luck.
    I used this links as reference:
    http://apex.oracle.com/pls/otn/f?p=31517:170:2228543603318893:::::
    http://www.oracle.com/technetwork/developer-tools/apex/tabular-form-090805.html (To build a tabular form manually:)
    http://apexjscss.blogspot.com/2010/05/manual-tabular-form.html
    Am i missing something ?
    APEX 4.1 on 11gr2
    regards,
    gw

    The "Display As" for each column should be "Standard Report Column".
    Seems the default "Display as" for standard reports has changed:
    I created your standard report in a 3.2 environment and the report defaulted the "Display As" for each column to "Standard Report Column".
    I created your standard report in my own 4.0 environment and in the hosted apex.oracle.com environment and the report defaulted the "Display As" for each column to "Display as Text (escape special characters, does not save state)"

Maybe you are looking for