So in Case Entry when I save a new case (in certain instances) I need the first task to be automagically marked completed and the second task brought in. This has not been as easy as it sounds.
Since the task BO isn’t run from the case BO, the only access I have to the task on a BPM is via a data directive. It all works fine, except the client side data doesn’t match and we get the “other user modified the row” message when saving.
So I’ve ended up in the customization checking the task edv from the notification. And that works okay, except if I include oTransUpdate I get the first TWO tasks completed and the third added, so I took the update out. (Having a save in the notification seems like a bad idea anyway.)
If the user hits save again at this point we’re good, but they might well not.
Even though I’ve changed the data, I don’t get a save prompt if I clear, exit, or open a new case. I’ve set the rowmod to “U” for both the task row and the case row (edvHDCase). I would think setting the rowmods would trigger the “do you want to clear” message ??
If the user leaves the record, we lose the completion of the task, even though it’s checked.
Care to see what I’ve done wrong?
Thanks,
Joe
private void edvTask_EpiViewNotification(EpiDataView view, EpiNotifyArgs args)
{
// ** Argument Properties and Uses **
// view.dataView[args.Row]["FieldName"]
// args.Row, args.Column, args.Sender, args.NotifyType
// NotifyType.Initialize, NotifyType.AddRow, NotifyType.DeleteRow, NotifyType.InitLastView, NotifyType.InitAndResetTreeNodes
if ((args.NotifyType == EpiTransaction.NotifyType.Initialize))
{
if ((args.Row > -1))
{
if (edvTask.dataView[args.Row]["TaskSetID"].ToString() == "ES-NoRMA" && edvTask.dataView[args.Row]["TaskSeqNum"].ToString() == "10" &&
edvTask.dataView[args.Row]["RelatedToFile"].ToString() == "HDCase" && Convert.ToBoolean(edvTask.dataView[args.Row]["Complete"]) == false)
{
edvTask.dataView[args.Row].BeginEdit();
edvTask.dataView[args.Row]["Complete"] = true;
edvTask.dataView[args.Row]["RowMod"] = "U";
edvTask.dataView[args.Row].EndEdit();
edvHDCase.dataView[args.Row].BeginEdit();
edvHDCase.CurrentDataRow["RowMod"] = "U";
edvHDCase.dataView[args.Row].EndEdit();
//oTrans.Update();
}
}
}
}