Delete data from table


I have created new table company_provident_pf.
I want to delete this table data when salary slip is delete.

How can I delete this?


Have you added this doctype as a Child Table in Salary Slip? If yes, then on deletion of specific Salary Slip record, value will be deleted from this doctype as well. Please further elaborate your query and indicate exact issue.

Hi @umair,

When I am going to cancel any salary slip then is showing
Cannot delete or cancel because Salary Slip Sal_Slip/EMP/0005/00006 is linked with company_contribution_pf PF/00014

I have created company_contribution_pf table and have done link with salary slip.

I don’t know that how I will create child table

Hi @umair,

Can I delete data manually using SQS query?
Where is deleting salary slip or any other document?
I did not find delete action

If Salary Slip is linked to another document, then you should first cancel/delete that document (your custom doctype record in this case), and then try to cancel and delete Salary Slip.

Hi @umair,

I know that.
I want to delete using SQL query.
Cause I did not implement any page for custom document.


Instead of using the SQL, You can delete the document using frappe.delete_doc the method just pass the doctype name and name of the document.


1 Like