Hi Sir,
Good Morning,i have two tables table1 and table2 when field status of table1 is approved then it should insert into table2 i have used this trigger but not firing
create or replace TRIGGER TRG_Times_INSERT
AFTER INSERT
ON Times
FOR EACH ROW
BEGIN
IF :NEW.STATUS = ‘APPROVED’ then
INSERT INTO APPROVE
(PID,BILLING_STATUS,TASKS,MONDAY,LOGM,NOTEM,TUESDAY,LOGT,NOTET,WEDNESDAY,LOGW,NOTEW,THRUSDAY,LOGTH,NOTETH,FRIDAY,LOGF,NOTEF,TOTALHOURS,STATUS,COMMENTS)
VALUES
(:NEW.PID,:NEW.BILLING_STATUS,:NEW.TASKS,:NEW.MONDAY,:NEW.LOGM,:NEW.NOTEM,:NEW.TUESDAY,:NEW.LOGT,:NEW.NOTET,:NEW.WEDNESDAY,:NEW.LOGW,:NEW.NOTEW,
:NEW.THRUSDAY,:NEW.LOGTH,:NEW.NOTETH,:NEW.FRIDAY,:NEW.LOGF,:NEW.NOTEF,:NEW.TOTALHOURS,:NEW.STATUS,:NEW.COMMENTS);
END IF;
END TRG_Times_INSERT;
I have done this process plz check it sir if anything is wrong.
Create a new process on the page/form level.
On the page level, you will find a process already created for the form or interactive grid. After that process, create a new process to delete the record. For example:
Delete from table2 where pid = :px_pid;
The trigger should also have an update clause because manager approval happens mostly in edit mode. So your trigger should be like this:
Thnx sir it works fine r8t now,
after approved as data is inserted into table2 that approved data should be deleted from table1,
can it be possible sir
It is better to delete automatically using the process from the Oracle Apex page.
On the form where the user is approving, after the main process, create another PL/SQL process to delete the record from table1.
So now, when the user will click on the Apply/Save button, it will first update with Approve status, then it will delete from the Table1.
How it works if staus will be rejected
First, you drag the process Delete above the Close Dialog process, else it will not execute. The close dialog process should be the last process.
To delete only the approved records, modify the process code as follows:
You can also specify the server-side condition for the Delete process. Select the server-side condition as item = value and select the item Px_STATUS and specify the value APPROVED.
In this case also, the Delete process will run when the status field value is approved.
Thnx Sir now it works fine absolutely,when ever i click on create,save button the application is closing automatically