what is trigger event for put request method. for example for get after_retrieve, for post after_save and for delete after_delete is there.
Thanks
what is trigger event for put request method. for example for get after_retrieve, for post after_save and for delete after_delete is there.
Thanks
Hi Francesca,
I am not seeing fetched_row field in response of PUT notification or POST notification .
Can you provide some more information..or am i incorrect somewhere to understand it?
I found arguments.isUpdate under after_save to distinguish between PUT and POST notification response in below document
after_save - SugarCRM Support Site
But in response i am not able to find isUpdate but able to see dataChanges
Please provide some light on it.Thank you.
Hi Francesca,
I am not seeing fetched_row field in response of PUT notification or POST notification .
Can you provide some more information..or am i incorrect somewhere to understand it?
I found arguments.isUpdate under after_save to distinguish between PUT and POST notification response in below document
after_save - SugarCRM Support Site
But in response i am not able to find isUpdate but able to see dataChanges
Please provide some light on it.Thank you.
Perhaps I'm not understanding your question...
The before_save, after_save etc are logic hooks triggered by actions on the module's beans.
For example when you save a bean the relevant before and after save logic hooks you have defined will be triggered.
So if you save modifications to an existing bean in your API call then the relevant logic hooks will trigger when you save those changes.
To define a Logic Hook you can follow the instructions here:
I am not seeing documentation about fetched_row, though it has been extensively used for years, but maybe I'm not looking in the right place.
When you are in a logic hook the $bean is passed as a parameter to the hook method.
If you are updating a bean then it also contains the $bean->fetched_row array which is the state of the bean before the save completes, the keys of that array are the fields that make up the bean.
Once the bean is saved that fetched_row no longer exists so you will not see it in the bean when looking at it in the after_save logic hook.
<?php
if (!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
class before_save_class
{
function before_save_method($bean, $event, $arguments)
{
//$bean->fetched_row exists here if this is an update
//$bean->fetched_row does not exist here if this is a new bean
//logic
}
}
?>