skearney
(Shannon Kearney)
February 11, 2019, 4:20pm
1
I would like to have a button to where I can mark a task complete in a customized form. I have created a Task Update Method. However, I am missing or have the incorrect parameters to identify the row I want to delete. I know I have to pass in parameters but I don’t know which ones and in what order?
//Customer - Update Task Method
private void CallTaskAdapterUpdateMethod()
{
try
{
var guidID = "1c628b7b-27b6-4c3d-8396-62349bc4e254"; //tbTaskID.Text;
TaskAdapter adapterTask = new TaskAdapter(this.oTrans);
adapterTask.BOConnect();
adapterTask.GetByID("SalesRep", "Credit", guidID);
adapterTask.TaskData.Task[0].PercentComplete = 100;
adapterTask.Update();
adapterTask.Dispose();
}
catch (System.Exception ex)
{
ExceptionBox.Show(ex);
}
}
tkoch
(Theodore Koch)
February 11, 2019, 4:35pm
2
These are the required parameters when calling GetByID
public TaskDataSet GetByID(string relatedToFile, string key1, string key2, string key3, int taskSeqNum);
jgehling
(Jeff Gehling)
February 11, 2019, 7:08pm
3
You can also utilize the object explorer in customization mode to find any method you need and the required params.
1 Like
skearney
(Shannon Kearney)
February 11, 2019, 8:12pm
4
@tkoch
This is what I ended up with. Thank you!
//Customer - Close Follow Up Task Method
private void CallTaskAdapterUpdateMethod()
{
try
{
var TaskSeqNum = Convert.ToInt32(neTaskID.Value);
TaskAdapter adapterTask = new TaskAdapter(this.oTrans);
adapterTask.BOConnect();
adapterTask.GetByID("SalesRep", "Credit", "", "",TaskSeqNum);
adapterTask.TaskData.Task[0].PercentComplete = 100;
adapterTask.TaskData.Task[0].StatusCode = "CMPLT";
adapterTask.TaskData.Task[0].Complete = true;
adapterTask.Update();
adapterTask.Dispose();
}
catch (System.Exception ex)
{
ExceptionBox.Show(ex);
}
}