How to add one column data to another column in same row in Interactive Grid on oracle apex?
How to add one column data to another column in same row in Interactive Grid on oracle apex?
❇️ OrclQA.Com is a question and answer forum for programmers.
❇️ Here anyone can ask questions and anyone can answer to help others.
❇️ It hardly takes a minute to sign up and it is 100% FREE.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
OrclQA.Com is a question and answer forum for programmers.
Here anyone can ask questions and anyone can answer to help others.
It hardly takes a minute to sign up and it is 100% FREE.
pavlos
Hi!
You can use pipes:
SM Hasem
I dont understand about your ans. In IG column have data from a table. I want to know that, same data add to other column. same as. Sal = 20000, update_sal = 20000.
SM Hasem
Thank you so much for your instant reply.
Vinish Kapoor
On what event do you want to copy the value from that column to another? On page load? Or when the user changes the value in the Service Charge column?
SM Hasem
This page have one Item, when this item change set have an action for below region refresh. after refresh need to this action sir.
SM Hasem
This page have one Item, when this item change set have an action for below region refresh. after refresh need to this action sir.
SM Hasem
Service charge data return to Collection Amount Column when change lOV -Bill Month.
Bill Month is item have refresh dynamic action.
Vinish Kapoor
Then create one more dynamic action (Execute PL/SQL code) on bill month LOV (before Refresh DA) to update the table the grid based on. Below is an example:
Then after the refresh, it will show the collection amount.
SM Hasem
Sorry Sir, I couldn't explain it to you.
Sir, I want to data transfer only form without update table. Its possible for this quary?
Sir, this data transfer service_charge column to collection_amount column then if need data modification, will done then insert into table.
SM Hasem
Thank you so much sir.
Vinish Kapoor
Ok, then create a dynamic action on the bill month item to execute JavaScript code. Also, specify a static id to your grid, for example, "igbill". Now add the below JavaScript code to it:
When the user changes the billing month, it will loop through the interactive grid and assign the service charge to the collection amount.
SM Hasem
Sir, data set after click every cell. not automatic set for all cell when change bill_month item.
when set action:change in dynamic action on bill_month DA fired but return null.
goto150
If I get your problem correctly you want to simply pass a value from one column to another in case initial value has changed.
If that's the case let me use EMP table as an example. DEPENDANT ("virtual") column I added just for the purpose of this example. It would react on change of EMPNO column.
This is source query for your interactive grid:
SELECT E.*, NULL AS DEPENDANT FROM EMP E
Here is explanation:
With this in place whenever you change value of EMPNO and then navigate to different cell, DEPENDANT will be updated.
SM Hasem
My Grid Source are below:-
select ROWID,
CLIENTS_ID,
TITLE,
PROJECT_NAME,
AREA,
SERVICE_CHARGE,
COLLECTION_AMOUNT,
BILL_MONTH,
SOFTWARE_STATUS,
ENTRY_DATE,
BILL_MONTH_2ND
from COLLECTION_LIST
where MONTH_WISE_DATE <= :P6_BILL_MONTH;
When change :P6_BILL_MONTH Item, I want SERVICE_CHARGE data set into COLLECTION_AMOUNT. I will edit COLLECTION_AMOUNT column then insert into my table. How can I do it?
goto150
Maybe you could simply solve this at the data source level. Assuming your :P6_BILL_MONTH is LOV accepting NULLs (Display Null Value = TRUE), then you could use NVL2 to display SERVICE_CHARGE in case :P6_BILL_MONTH is selected (meaning not null).
SM Hasem
When use this code, grid save button not working. How to use save or any button to save data grid to table?
goto150
You're right. My bad, firstly this NVL2(:P5_BILL_...) column is virtual and secondly it does not leave cells in edit mode. I'd say lose-lose instead of win-win:)
Lets try JavaScript. For the demo I am going to create a button to fire DA.
I hope this would help you, and the reason I did not add this to Change event of the LOV is that I would not know how to easily chain Refresh() --> DA (Fill collection amount). If you put both: Refresh and DA under :P6_BILL_MONTH Change() event, both will fire synchronously and you won't get your collection column refreshed.