I have a strange issue. I'm trying to add a task related to a lead. I wrote the following code and it works fine and appears under the lead under activities. However, when I browse the tasks, the "Related Entity Description" field is blank. I looked at the code behind it and it appears related entity description should be automatically calculated from the RefNoteId in Acumatica 6. If I manually create an item under the lead/activity then all other lead/activities update the "related entity description" properly. Looking at the source, it appears this field is myTask.Source which is a string value and I'm not sure what it should be set to since it should be calculated automatically with the noteid. I looked in the SQL database and all fields from a manually created task and my automatic created task including the NoteID are correct so it appears I'm missing some sort of "update" command. Any insight what I am missing to get the "Related Entity Description" to calculate correctly? Thanks.
private void followuphelper(int daysToFollowUp)
{
#region Event Handlers
Contact curLead = Base.LeadCurrent.SelectSingle();
CRTaskMaint graph = CRTaskMaint.CreateInstance<CRTaskMaint>();
CRActivity myTask = new CRActivity();
myTask.Subject = String.Format("FollowUp Lead");
myTask.ClassID = 0;
DateTime dueDate = DateTime.Now;
myTask.StartDate = dueDate;
myTask.EndDate = dueDate.AddDays(daysToFollowUp); //2 weeks
myTask.RefNoteID = curLead.NoteID;
myTask.ContactID = curLead.ContactID;
CRActivity task = (CRActivity)graph.Tasks.Insert(myTask);
Base.Actions.PressSave();
graph.Actions.PressSave();
}