Page 1 of 1
Deleting Checklist and Requested Tasks
Posted: Mon Nov 17, 2008 2:38 pm
by roteague
Is there any programmatic method for deleting IChecklistTask and IRequestedTask items? If not, will this functionality be implemented in future revisions of SoftPro?
Thanks,
Re: Deleting Checklist and Requested Tasks
Posted: Fri Nov 21, 2008 11:51 am
by Phil Barton
The ChecklistTask and RequestedTask collections on the IOrder interface include a Remove(..) method and a RemoveAt(...) method. The Remove method takes as its parameter the object to remove; the RemoveAt method takes as its parameter the index into the collection of the object to remove. The following code snippets show how to use the Remove(...) method for IRequestedTask objects (IChecklistTask objects will follow the same pattern):
C#
Code: Select all
IRequestedTask task1 = order.RequestedTask.CreateNew();
IRequestedTask task2 = order.RequestedTask.CreateNew();
task1.Task = @"Task1";
task2.Task = @"Task2";
order.RequestedTask.Remove(task1);
VB
Code: Select all
Dim task1 As IRequestedTask
Dim task2 As IRequestedTask
task1 = order.RequestedTask().CreateNew()
task2 = order.RequestedTask().CreateNew()
task1.Task() = "Task1"
task2.Task() = "Task2"
order.RequestedTask.Remove(task1)
Re: Deleting Checklist and Requested Tasks
Posted: Fri Nov 21, 2008 2:02 pm
by roteague
Thanks Phil. Sorry, I don't know why I didn't see that method.
Have a great weekend,