Dear frends is there any block level commit function as i want to save the changes only in my current block regardless of others. (clear_block can solve the problem but in this case i'v to requery the block to display changes.)
Hi,
Assume that you have Form made of Two blocks A & B.
Make two Package Varibales X & Z.Keep the Default value of noth of these as N.
If you chnage any feild in Block A set the vlaue of Varibale X to Y.
Now if user chnages any feild in block B also then check if Value of X is already Y then let the value of Z remain N else chnage it to Y.
Add On-Insert trigger on each Block.
In block A's Trigger check
if X ='Y' then
INSERT_RECORD;
else
NULL;
End If;
Similarily add code in Block B's trigger.
Note that value of Z is N so the code will go in Else part which is NULL , hence no data will be inserted.
Create Similar triggers On-Update/On-Delete for Update/Delete statements.
Himanshu, I thought that the idea was to commit single block without affecting others and defer posting changes in other blocks. In this case instead of "NULL;" it would be better to store changed record numbers and then restore record statuses to be processed by "ordinary" commit.
But in such situations I usually recommend placing blocks on different forms.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.