Hello,
Can you guys/gals help in doing the following:
- Delete all Project Tasks when its Project is deleted
- Show warning or some indication when the project task end date is past the project end date
Hello,
Can you guys/gals help in doing the following:
- Delete all Project Tasks when its Project is deleted
- Show warning or some indication when the project task end date is past the project end date
CE 6.0.1beta2
Hello,
You can use after_delete logic_hook to delete the related records.
Thumbs up.
Skype ID - david__boris
SugarForge Projects:
WYSIWYG now in studio!(Version 1.1 is out now!)
Sugar Feeds on your personalized home pages like iGoogle, My Yahoo!, etc.
Fab Tools! > Dashlet Not Followed Opportunities for past six Months
Hello,
I did the logic hook and it works; however, I am not sure how to start the deletion process.
Can you put on the right track.
Thank you
Logic Hook
Deletion FilePHP Code:<?php
$hook_version = 1;
$hook_array = Array();
$hook_array['after_save'] = Array();
$hook_array['after_save'][] = Array(1, 'ProjectAssignmentNotification',
'custom/modules/Project/email_notes.php',
'userNotification',
'notifyAssignee');
$hook_array['after_delete'] = Array();
$hook_array['after_delete'][] = Array(1, 'ProjectAssignmentNotification',
'custom/modules/Project/delete_children.php',
'deleteChildren',
'deleteChild');
?>
PHP Code:<?php
class deleteChildren{
function deleteChild(&$bean, $event, $arguments)
{
echo "delete ok";
break;
}
}
?>
CE 6.0.1beta2
Hello,
Write following code in function,
PHP Code:$sugarbean = new ProjectTask();
$query = "SELECT id FROM project_task WHERE project_id = '" . $bean->id . "' AND deleted = 0";
$result = $sugarbean->db->query($query,true,"Error retrieving project tasks");
while($row = $sugarbean->db->fetchByAssoc($result))
{
$sugarbean->mark_deleted($row['id']);
}
Thumbs up.
Skype ID - david__boris
SugarForge Projects:
WYSIWYG now in studio!(Version 1.1 is out now!)
Sugar Feeds on your personalized home pages like iGoogle, My Yahoo!, etc.
Fab Tools! > Dashlet Not Followed Opportunities for past six Months
Hello,
It did not work. The project get deleted and the project task are not.
There is no error.
The code does not go inside the while loop.
Any idea?
OOzy
CE 6.0.1beta2
Hello,
Use before_delete logic hook instead.
Thumbs up.
Skype ID - david__boris
SugarForge Projects:
WYSIWYG now in studio!(Version 1.1 is out now!)
Sugar Feeds on your personalized home pages like iGoogle, My Yahoo!, etc.
Fab Tools! > Dashlet Not Followed Opportunities for past six Months
Bingo!! Worked like a charm!
Thank you
OOzy
CE 6.0.1beta2
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks