Prevent Users from Deleting Quotes

I need to prevent users from deleting quotes accidentally. I disabled access to bo.Quote.DeleteByID to anyone but Security Managers in our test environment, and I’m finding that by design this also prevents any user from deleting anything inside the quote, such as Lines or Misc Charges as well.

How would I go about stopping someone from deleting the entire quote, without stopping them from deleting anything else inside the quote?

DeleteByID typically calls Update to actually write the changes to DB. Try going into Quote.Update and adding a check for header rows where RowMod == “D”.

1 Like

I understand completely what you mean, but I don’t know how to implement it. I assume it’s a custom code block. I appreciate the input however I found a way to do it without any code.

I instead opted for a pre-processing method directive on Quote Update. The first condition is:
“The user who called the method does not belong to [A security group with our admins in it] group”
AND “There is at least one deleted row in the ds.QuoteHed table.” This does work as expected, our users can delete whatever they want inside the quote, but not the entire quote.

If the condition evaluates True then this goes into a second condition that catches the specific user who caused this problem with “This method is called by [user]” if True this raises an exception with a Rickroll embedded via <video> element, if false, the rest of our users get a normal error.

Funny that Kinetic strips iframe elements and style attributes, but doesn’t block <video>. You can also use <a> and I assume even <img> freely. Curious what else I can use now…

That is the exact same thing, under the hood, as I suggested. Glad it worked out for you.

I probably would have done this in widgets too, but I was writing code for something complicated when I saw your post so my head was in “code mode”.

You are hired. When can you start?

I need a Pop up to confirm the user for delete the record. If they click no, nothing should happen.
Do you have any idea how to achieve this without throwing an error.

If you go into something like order entry or job entry, click the three dots in the top right, then click on Settings, you’ll see Confirmation Dialog Options. Expand the Delete card and check “Confirm Delete on delete button”

That should be default behavior, so if you click Restore defaults the result is this box should be checked. This is also a user preference so if your users are turning it off you’ll have to write a directive to force a confirmation. See KB0098313 for the latter.

Thanks. But I need it in the Classic Version not the Kinetic

Classic does have those same options. Double click the Kinetic icon in your system tray to open the System Monitor. Tools > Options > Dialogs > Delete

Confirm to delete should also already be default behavior in Classic. I always get confirmations to delete important things like jobs, quotes, customer records, etc already.