Restricted Delete Action in Table D365 F&O

Rumman Ansari   Software Engineer   2023-09-02   784 Share
☰ Table of Contents

Table of Content:


Restricted Delete Action in Table D365 F and O

In case of Restricted Delete Action you can delete record from parent table if there is no dependent data in child table. If there will be dependent data, system will show warning message that data present in child table. So to delete record from parent table first we have to delete all records from child table which is dependent after that we will be able to delete record from parent.

Remember if we want to apply the Restricted delete operation on Employee Table then we have to create relationship on the Employee Table and apply On delete property Restricted to it on relationship.

Restricted Delete Action in Table D365 F&O
  1. You need two table Department table and Employee Table.
  2. Create a normal relationship between them in Employee table.
  3. Set on delete property in Employee table as Restricted. See screenshot.
  4. Then build and run to see result. When we will try to delete records from Employee table then Department Table data will not be deleted automatically, It will show below warning message.

    Department Table cannot be deleted while dependent EmployeeTable exist. Delete dependent EmployeeTable and try again.

  5. So, to delete record from Department table first delete all dependent data from EmployeeTable. Then you will be able to delete record from Department table.

Another way you can do that also

Remember if we want to apply the Restricted delete operation on Department Table then we have to create relationship on the Department Table and apply On delete property Restricted to it on relationship.

  1. You need two table Department table and Employee Table.
  2. Create a normal relationship between them in Department table.
  3. Set on delete property in Department table as Restricted. See screenshot.
  4. Then build and run to see result. When we will delete records from Employee table then Department Table data will not be deleted automatically, It will show below warning message.

    Employee Table cannot be deleted while dependent DepartmentTable exist. Delete dependent DepartmentTable and try again.

  5. So, to delete record from Employee table first delete all dependent data from DepartmentTable. Then you will be able to delete record from Employee table.
Restricted Delete Action in Table D365 F&O Restricted Delete Action in Table D365 F and O

You will get error like below.

Restricted Delete Action in Table D365 F&O