+ Start a Discussion

Executing common code at end of transaction.


    Is there any way to write code at the end of transaction. I am planning of logging debug logs in custom object as records. So that after every transaction i will save all debug records to salesforce. I have written a remote function to access all debugs from this custom log. So in browser only i can check all debugs no need to go to salesforce debug everytime for debugging. I can debug my code right in the browser's console. Only problem that I am facing is that if I try to insert record for every debug message then I might run out of dml statements. So I was considering of inserting all debug logs at the end of transaction. So Is there any way (or place) to write code which will execute at end of transaction. This custom debug logger write in browser's console would be of greate help.