Topic by Chakravarthy Elchuri
Hi all,
I have a button on Custom object work space, if i click on button it will open a new Incident work space.i am able to open and assign contact to new incident work space.
below is the code i am using on workspace button click
context = _glbcontext.AutomationContext.CreateWorkspaceRecord(RightNow.AddIns.Common.WorkspaceRecordType.Incident);
voidcontext _dataloaded(object sender, EventArgs e)
{
IIncident incident = IRecordContext.GetWorkspaceRecord(RightNow.AddIns.Common.WorkspaceRecordType.Incident);
IList<IInc2Contact> contactList = new List<IInc2Contact>();
IInc2Contact inc2Contact = AddInViewsDataFactory.Create<IInc2Contact>();
inc2Contact.Cid = 123; //Convert.ToInt32(123);
inc2Contact.Prmry = true;
contactList.Add(inc2Contact);
incident.Contact = contactList;
incident.Subject = "test";
context.RefreshWorkspace();
context.ExecuteEditorCommand(RightNow.AddIns.Common.EditorCommand.Save);
}
It is working fine and my question is this correct way or any simple method is there to load and pre populate custom object values on incident work space.
Thanks,
Chakravarthy.