You can definitely update the parent when the DML operation happens on the child, but the before / after insert / update / delete trigger would be written for the child because the parent would not have knowledge of the operation...i.e. nothing is explicitly happening to the parent, so no trigger would fire for it.
Mike is correct and if you are writing a new trigger that is how I would do it, however if you have an existing trigger on the parent object that you wanted to fire when the child is updated you could create a hidden custom field on the parent and update it via a field update when the child is updated, which would cause the trigger on the parent to fire.
Thanks MIke and Jake for your reply.I am going with workflow field update to fire the existing trigger on parent.but i need to know how to update the field with new value everytime the workflow kicks off.
You can definitely update the parent when the DML operation happens on the child, but the before / after insert / update / delete trigger would be written for the child because the parent would not have knowledge of the operation...i.e. nothing is explicitly happening to the parent, so no trigger would fire for it.
Mike
Mike is correct and if you are writing a new trigger that is how I would do it, however if you have an existing trigger on the parent object that you wanted to fire when the child is updated you could create a hidden custom field on the parent and update it via a field update when the child is updated, which would cause the trigger on the parent to fire.
Thanks MIke and Jake for your reply.I am going with workflow field update to fire the existing trigger on parent.but i need to know how to update the field with new value everytime the workflow kicks off.
Use a formula as the condition and set it to 1=1, that is always true and so will update the field everytime that it is checked.