How to know in before save or after save logic hook data insert through api or sugarcrm application. ..?