I've added Notes/History List to a custom entity 'Project'. The customer wants the Contact, Account, Opportunity, and Project to automatically fill in when opened. I've tried a couple of different things. I added onto SetTACODefaultsFromEntityHistory with a "case 'IProject'" and modified FillForm() at the end to get the parent and set them based on that in the ActivityDetails.ascx.cs file. Nither work. Does anyone have any ideas?
I tried to see if I could find the "AddNote" javascript that is called on the button click because I figured I could add Paramaters to set the fields using that, but I couldn't find it. Does anyone have any ideas?
<p> case "IProject":
found = true;
IProject project = EntityFactory.GetById<IGDCGProject>(hist.EntityId.ToString());
if (project != null)
{
Activity.ProjectID = hist.EntityId.ToString();
Activity.AccountId = project.AccountID;
Activity.OpportunityId = project.OpportunityID;
}
break;
<p>object parent = this.GetParentEntity();
if (parent is Sage.Entity.Interfaces.IGDCGProject){
IGDCGProject project = (Sage.Entity.Interfaces.IGDCGProject)parent;
Activity.GDCGProjectID = project.Id.ToString();
Activity.AccountId = project.AccountID;
Activity.OpportunityId = project.OpportunityID;
Activity.ContactId = project.ContactID;
}
|