Hi everyone, I used the apex of 2020. I have one case as when create new interactive grid where column A is selected sum that must equal = 100. I used two cases but it was not unsuccessful.
- The first case, I tried to create validation for column but it was suitable for editing ( because recorded rows), with creating new, database has been not recorded, so that validation has been not checked.
- The second case, I create a trigger for a table (new interactive grid) when after insert
CREATE OR REPLACE TRIGGER TRIGGER2
after INSERT OR UPDATE OF COLUMN A ON TABLE
declare
v_weight number;
BEGIN
select nvl(sum(A),0)
into v_weight
from TABLEgc
where gc.grading_id = v('GRADING_ID');
where v('GRADING_ID) - I create this item on applicaiton and assign to page item
if v_weight <> 100 then
raise_application_error(-20111,'This total must equal = 100%');
end if;
END;
Thank you in advance. I hope everybody give me new idea or new skills.