From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

VeriStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Allow Software to Delete Channels, but Not User

Solved!
Go to solution

I am using the OnDeleteRequest action to prevent the user from deleting channels in my custom device.  However I realized that this also prevents code I write (in this case executing on a right-click action) from deleting channels.  I need a way to differentiate so that the user cannot simply delete channels, but my different actions can.

 

Here's what I've tried:

  • Setting an AllowDelete? property on the custom device top level item for the duration of my action that needs to delete items and then checking for it in the OnDeleteRequest method - no go
  • Setting an AllowDelete? property on the custom device top level item in the action and removing it when the page that has the right-click action is loaded (I reload after the action) and then checking for it in the OnDeleteRequest method - no go
  • Setting an AllowDelete? property on the custom device top level item for the duration of the page that has the right-click action and checking for it in the OnDeleteRequest method -  . . . well I'm posting here so . . .

 

I am using VeriStand 2013 and I am setting the Force Delete input of the Remove Item function to True.

 

Thanks,

Chris
Project Engineer
Certified LabVIEW Architect
Certified TestStand Architect
0 Kudos
Message 1 of 4
(5,436 Views)
Solution
Accepted by topic author Call_Me_Vinny

Fixed my own problem about 20 minutes later . . . .

 

The delete flag did work inside the action - I'd just gotten lost in the tree in the OnDeleteRequest VI and forgotten to get back up to the custom device root.

 

Hope this saves someone else the trouble!

Chris
Project Engineer
Certified LabVIEW Architect
Certified TestStand Architect
Message 2 of 4
(5,434 Views)
You can use the <DeleteProtection> tag on a page in your XML. Then users cannot delete items using that page, but the custom device can. Also, the force delete input to Remove Custom Device Item.vi (and Items.vi) just skips the warning dialog allowing the user to cancel.
Stephen B
Message 3 of 4
(5,406 Views)

Good to know, thanks Stephen!

Chris
Certified LabVIEW Architect
Certified TestStand Architect
0 Kudos
Message 4 of 4
(5,400 Views)