How to restrict record inactivation if the record is referencing in other active tables

pavankumar970
Tera Contributor

Hii,

 

I have a requirement that is, 

  I need to restrict department record to set active false when it is referencing in any other active table records.

 

Can somebody please help me with this..?

1 ACCEPTED SOLUTION

Mark Manders
Mega Patron

So if the department is selected in any active record, it can't be inactivated? 

Are we just talking about active tickets, or active everything (like locations, users, assets, cmdb, etc?). I think the only way to do this is to check where you are using it and do a validation on those fields. If you are lucky, you can simply run it on top tables (like 'department' field on task-level). 
Create a BR on change of active field and let it abort if the check on any record is true (let your script run through all tables where you are using 'department'.


Please mark any helpful or correct solutions as such. That helps others find their solutions.
Mark

View solution in original post

1 REPLY 1

Mark Manders
Mega Patron

So if the department is selected in any active record, it can't be inactivated? 

Are we just talking about active tickets, or active everything (like locations, users, assets, cmdb, etc?). I think the only way to do this is to check where you are using it and do a validation on those fields. If you are lucky, you can simply run it on top tables (like 'department' field on task-level). 
Create a BR on change of active field and let it abort if the check on any record is true (let your script run through all tables where you are using 'department'.


Please mark any helpful or correct solutions as such. That helps others find their solutions.
Mark