Project and Portfolio Management Practitioners Forum
cancel
Showing results for 
Search instead for 
Did you mean: 

Dynamic Addition Of Rows in Table Component

Highlighted
AShameem
Super Collector

Dynamic Addition Of Rows in Table Component

Hello,

Can we prepopulate a table component with some rows at request creation/Execution Step.

Thanks
4 REPLIES
Shilpesh P
Acclaimed Contributor

Re: Dynamic Addition Of Rows in Table Component

Hi,

You can do it through Execution step.
you would have to insert records in KCRT_TABLE_ENTRIES table as well you need update KCRT_REQUEST_DETAILS table to reflect the correct no. of entries on the dashbaord.

Regards,
Shilpesh P
Jim Esler
Honored Contributor

Re: Dynamic Addition Of Rows in Table Component

And in order to be sure the new data displays properly immediately, you need to clear the Table Field Entries cache.
Kushalch
Super Collector

Re: Dynamic Addition Of Rows in Table Component

hi,

 

related to the addition, we have a requiremnent where we want to add a new row in a table in 1 request from a table in request 2. the rows are added fine when we add a row in the last but not when we add somewhre in the table ie in middle.

 

please let me know how to compare the rows and handle this.

 

for eg. in 1st request we added 2 rows so the seq are 1 and 2. now we add a row in between 1 and 2. ie seq 2 becomes 3 and the new row 2 and so on...

Re: Dynamic Addition Of Rows in Table Component

The easiest way would be deleting and inserting again the ros with new table ids, the work there would be doing it in each step of your workflow where you need that functionality.

 

Like the following example:

 

PROCEDURE CargaTablaInicial(p_request_id IN NUMBER,p_nombre_tabla IN varchar2,p_token_tabla IN varchar2,p_reference_code varchar2) as

CURSOR VALORES_TABLA IS
SELECT ROWNUM FILA,VT.ID_COLUMNA,VT.VALOR_COLUMNA,VT.VALOR_COLUMNA2,VT.VALOR_COLUMNA3
FROM ALCP_VALORES_TABLA VT
WHERE VT.ID_TABLA=p_nombre_tabla AND VT.ESTADO_COLUMNA='A';

BEGIN

FOR CUR_VT IN VALORES_TABLA LOOP

INSERT INTO KCRT_TABLE_ENTRIES(
SELECT KCRT_TABLE_ENTRIES_S.NEXTVAL,
1,
CURRENT_DATE,
1,
CURRENT_DATE,
P_REQUEST_ID,
(SELECT PSF.PARAMETER_SET_FIELD_ID FROM KNTA_PARAMETER_SET_FIELDS PSF WHERE SUBSTR(PSF.REFERENCE_CODE,0,LENGTH(p_reference_code))=p_reference_code AND PSF.PARAMETER_TOKEN=P_TOKEN_TABLA),
CUR_VT.FILA,
(SELECT PSF.PARAMETER_SET_CONTEXT_ID FROM KNTA_PARAMETER_SET_FIELDS PSF WHERE SUBSTR(PSF.REFERENCE_CODE,0,LENGTH(p_reference_code))=p_reference_code AND PSF.PARAMETER_TOKEN=P_TOKEN_TABLA),
CUR_VT.VALOR_COLUMNA,CUR_VT.VALOR_COLUMNA,
CUR_VT.VALOR_COLUMNA2,CUR_VT.VALOR_COLUMNA2,
CUR_VT.VALOR_COLUMNA3,CUR_VT.VALOR_COLUMNA3,
NULL,NULL,NULL,NULL,
NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,
NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,
NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,
NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,
NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,
NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,
NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,
NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,
NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL
FROM DUAL
);

END LOOP;

COMMIT;

EXCEPTION
WHEN OTHERS THEN
ROLLBACK;

END CargaTablaInicial;

//Add this to "OnDomLoad" event