Hi,
Can anyone suggest me a solution about how do i delete multiple data using sugarcrm API?
i.e.
I have a user who have multiple licenses, I want to delete all his licenses at a time on the basis of its user id
How do I do that?
Hi,
Can anyone suggest me a solution about how do i delete multiple data using sugarcrm API?
i.e.
I have a user who have multiple licenses, I want to delete all his licenses at a time on the basis of its user id
How do I do that?
Good morning Rana,
In response to your direct message, I am sorry, I don't have a code snippet ready to share with you but this should help.
Your script can loop through your list of IDs and mark each one as deleted as follows:
Fetch your user's record SugarBean using the "retrieveBean" and the user's id
use the relationship to the licenses to get the related licenses' ids:
And delete each one using the DELETE api explained here:
In general, you can find a number of examples in curl or PHP starting here:
If you want to do all the Deletes in a single API call try using the BULK POST for your Deletes:
I hope this gives you a good starting point.
FrancescaS
Good morning Rana,
In response to your direct message, I am sorry, I don't have a code snippet ready to share with you but this should help.
Your script can loop through your list of IDs and mark each one as deleted as follows:
Fetch your user's record SugarBean using the "retrieveBean" and the user's id
use the relationship to the licenses to get the related licenses' ids:
And delete each one using the DELETE api explained here:
In general, you can find a number of examples in curl or PHP starting here:
If you want to do all the Deletes in a single API call try using the BULK POST for your Deletes:
I hope this gives you a good starting point.
FrancescaS