Skip to main content
Answer

How to delete a canceled Service Contract

  • June 29, 2022
  • 2 replies
  • 117 views

Forum|alt.badge.img

I have a request from a client to delete all “Canceled” Service Contracts

I tried adding a delete button to the Service Contracts GI.
This resulted with: Error: The record cannot be deleted.

 

Different approach: I tested using a SQL DELETE in my local Acumatica instance database.to bulk delete all existing Service Contracts that have a status of “Canceled”

                  DELETE FROM [FSServiceContract] WHERE Status = 'X'

This appears to have deleted all the Service Contracts that have a Status of “Canceled”, which is what the customer wants. 
Note: This SQL approach does bypass business rules in this module.
 

Question: Is there a better (preferred) approach to deleting Service Contracts that have a Status of “Canceled”?

My customer requests:

  1. Bulk delete all of the Service Contracts that have a status of “Canceled”.
  2. Give them the ability to delete Service Contracts that have a status of “Canceled” on their own.

Thank you in advance.

Ken Severud

 

 

 

Best answer by Laura03

Hello,

I can’t recommend using SQL to delete out of tables in the database.  (Using SQL to delete is never the Better/Preferred approach.)

I wonder whether you’ve considered using Filters to ‘hide’ or at least move the canceled contracts out of the way of the users?

Add filter in Service Contracts based on status.  Make a tab that includes where status <> canceled the default tab.

Inside the screen, where you click magnifying glass to see contract lookup list, make the same filter: create a tab that does not include canceled contracts and make the new tab the default for all people.

Good luck.

2 replies

Laura03
Captain II
Forum|alt.badge.img+19
  • Captain II
  • Answer
  • June 30, 2022

Hello,

I can’t recommend using SQL to delete out of tables in the database.  (Using SQL to delete is never the Better/Preferred approach.)

I wonder whether you’ve considered using Filters to ‘hide’ or at least move the canceled contracts out of the way of the users?

Add filter in Service Contracts based on status.  Make a tab that includes where status <> canceled the default tab.

Inside the screen, where you click magnifying glass to see contract lookup list, make the same filter: create a tab that does not include canceled contracts and make the new tab the default for all people.

Good luck.


Forum|alt.badge.img
  • Author
  • Freshman II
  • June 30, 2022

Laura,

I appreciate your suggestion. I’ll give it a try.

Thank you!
-Ken