You should be able to access attributes of a deleted record with entity\attribute('attributeName'); But I'm not sure.
I'd recommend using a workflow rule for such simple tasks.
Access record after @delete event
Collapse
X
-
I've slimmed it down to a very basic workflow, that catches a @delete event, and calls a BPM process that creates a notification.
The Travel event that I'm removing has this id: 64a24fea1f9d88514
I am seeing the flow trigger:
The notification is sent fine if I create the notification directly in the workflow, instead of the BPM process that is called by the workflow.
This sounds like a bug?
I'm on Espo 7.5.5
PHP 8.2.4 (cli)Last edited by Maarten; 07-03-2023, 03:28 PM.Leave a comment:
-
Hi Rabbi,
Thanks for your response. I've tried the 'deleted' true filter on a record that was deleted, but it returns a null still.
You code also suggest that the $id returned by record\findOne is different from id. But shouldn't they not be the same?
Leave a comment:
-
I have a workflow that catches the @delete event. I want to be able to take an action following this event, for which I need some attributes from the deleted record. However, the record is not available anymore, and I'm getting thrown null errors in the logfile.
Is there a way to access attributes from deleted records?
PHP Code:$id = record\findOne('Opportunity', 'createdAt', 'desc', 'id=', id, 'deleted', true);
$name = record\attribute('Opportunity', $id, 'name');
hope this helpsLeave a comment:
-
Access record after @delete event
I have a workflow that catches the @delete event. I want to be able to take an action following this event, for which I need some attributes from the deleted record. However, the record is not available anymore, and I'm getting thrown null errors in the logfile.
Is there a way to access attributes from deleted records?Tags: None
Leave a comment: