Add a Task

Discussions related to custom development with Select.
Post Reply
tmeisinger
Posts: 75
Joined: Fri Apr 24, 2015 10:33 am

Add a Task

Post by tmeisinger »

I would like to add a Requested Task to an order during OrderSaving.
I thought it would be like an AdditionalTitleCharge, but I'm not able to CreateNew("Task").
Could you give me a little idea how best to work with Tasks.

Code: Select all

ISecurityIdentity AssignedTo = sm.Identities.Where(v => v.FullName == "Something").FirstOrDefault();

dynamic newTask = iOrder.CreateNew("Task");
newTask.Description = "something";
newTask.Status = TaskStatusType.Requested;
newTask.AssignedTo = AssignedTo;
order.Tasks.Add(newTask);
BobRichards
Posts: 1376
Joined: Wed Jan 15, 2014 3:50 pm
Location: Raleigh, NC
Contact:

Re: Add a Task

Post by BobRichards »

That is really close! You must create a new "ChecklistTask" or "RequestedTask" and add it to the Tasks collection like you are doing.
Bob Richards, Senior Software Developer, SoftPro
Post Reply