Reputation: 41
Good day,
I am trying to capture date from a apex_item.text but its not working
my classic report table is
SELECT apex_item.checkbox2(1,productID,'class=indCheck')
|| apex_item.hidden(2,productname)
|| apex_item.hidden(3, productcode)
|| apex_item.hidden(5,amount)
as "SELECT",
PRODUCTID,
PRODUCTCODE,
PRODUCTNAME,
PRODUCTDESC,
CATEGORYCODE,
SERIALNUMBER,
UNITPRICE,
REORDERLEVEL,
DISCONTINUED,
UNITSINHAND,
STATUS,
LOCATION,
LOCATIONDESCRIPTION,
apex_item.text (20,amount) as amount
from PRODUCTS
my pl/sql consist of
begin
for idx in 1 .. apex_application.g_f01.count loop
if apex_application.g_f01(idx) is not null then
insert into pending
(products,employeename,department,dates ,amount
)
values
(apex_application.g_f02(idx),:app_user,:app_user,
sysdate,apex_application.g_f05(idx));
end if ;
end loop;
end;
everything is being captured except the apex_item.text (20,amount) as amount
which is being reference with apex_application.g_f05(idx)
Upvotes: 1
Views: 2736
Reputation: 96
I did use the same code as you are using and it worked fine.
See my understanding.
Table 1:
DROP TABLE ASHISH_SAMPLE_EMP CASCADE CONSTRAINTS;
CREATE TABLE ASHISH_SAMPLE_EMP
(
EMPNO NUMBER,
ENAME VARCHAR2(20 BYTE),
SAL NUMBER,
LOC VARCHAR2(22 BYTE),
DEPT VARCHAR2(22 BYTE),
ACTIVE VARCHAR2(4 BYTE) DEFAULT 'N'
);
Sample data
SET DEFINE OFF;
Insert into ASHISH_SAMPLE_EMP
(EMPNO, ENAME, SAL, LOC, DEPT,
ACTIVE)
Values
(1, 'Sahay', 1000, 'Delhi', 'SOFTWARE',
'N');
Insert into ASHISH_SAMPLE_EMP
(EMPNO, ENAME, SAL, LOC, DEPT,
ACTIVE)
Values
(4, 'TEst', 555, 'Noida', 'DBA',
'N');
Insert into ASHISH_SAMPLE_EMP
(EMPNO, ENAME, SAL, LOC, DEPT,
ACTIVE)
Values
(7, 'TEst', 555, 'Noida', 'DBA',
'N');
Insert into ASHISH_SAMPLE_EMP
(EMPNO, ENAME, SAL, LOC, DEPT,
ACTIVE)
Values
(2, 'Ashish', 1000, 'Gurugram', 'IT2',
'N');
COMMIT;
Table 2:
CREATE TABLE ashish_apex_item_issue
(
empno NUMBER,
amount NUMBER
);
Report Query
select apex_item.checkbox2(1,empno,'class=indCheck') || apex_item.hidden(5,sal) as "SELECT",
EMPNO,
ENAME,
apex_item.text (20,SAL) as amount,
LOC,
DEPT,
ACTIVE
from ASHISH_SAMPLE_EMP
Save data Process
begin
for idx in 1 .. apex_application.g_f01.count loop
if apex_application.g_f01(idx) is not null then
insert into ashish_apex_item_issue
(empno,amount
)
values
(apex_application.g_f01(idx),apex_application.g_f05(idx));
end if ;
end loop;
end;
Please follow the below article
https://roelhartman.blogspot.com/2018/02/apexapplicationgf0x-array-processing-in.html
Upvotes: 1