Skip to main content

Is there a way to delete all the items from the List View in a single click (apart from Clear method of course)? Clear method just clears the view but doesn't delete the data from the SmartObject n Tables.

Hi,

 

Does your list items have a common property ie; lets say requestId. If so what you can do is write a method that deletes all records with that common property. WHen delete is clicked call that method and then refresh the list.

 

Hope ths helps.


You might have to create a dynamic sql stored procedure that is tailored to what you need.


 


example:


declare @tablename varchar(20)


set @tablename = 'table1'


declare @command varchar(2000)


set @command = 'delete from ' + @tablename 


exec(@command)


 


If you build a stored procedure, when you refresh your SQL service instance it will be exposed and you can wrap a smartobject around it.


Reply