You need to sign in to do that
Don't have an account?
Silpi roy 16
Trigger for deletion of record
Hi
My scenario is :
Billing Document:Parent
Billing Item:Child
I need a detion trigger to delete Billing Item with Unit Price=0/Blank and Subsegment=Undefined.
Note:Billing document can also be created from SAP.So if any Billing Item with above mentioed criteria is there it should also get deleted
Thanks!!
My scenario is :
Billing Document:Parent
Billing Item:Child
I need a detion trigger to delete Billing Item with Unit Price=0/Blank and Subsegment=Undefined.
Note:Billing document can also be created from SAP.So if any Billing Item with above mentioed criteria is there it should also get deleted
Thanks!!
i think we can just write the trigger operation on the child record, and if the condition met we can perform the dELETE Operation on that particulr record. So only child get deleted.
it wont effect any respective parent record.
I am not clear about your query, could you please elobarate it?
Here is the code for the trigger for deletion of a record, I hope this will help you
Regards
Ajvad Aju
Getting Error:Apex trigger deleteBillingItem caused an unexpected exception, contact your administrator: deleteBillingItem: execution of AfterUpdate caused by: System.SObjectException: DML statement cannot operate on trigger.new or trigger.old: Trigger.deleteBillingItem: line 10, column 1
I changed the code of Ajvad Aju slightly and tried it out, it's working for me.
Below is the changed code
Hope this solves your issue.
Thanks,
Sibasish