Copying Object with WorkspaceRibbonButton AddIn
Content
Hi all,
I have developed a WorkspaceRibbonButton AddIIn, which has to copy some fields from Answer object, then make a new Answer object with pasted fields.
The case is that when I make new Answer object with
IRecordContext _recordContextanswer2 = (IRecordContext)_globalContext.AutomationContext.CreateWorkspaceRecord(RightNow.AddIns.Common.WorkspaceRecordType.Answer);
the new AddIn is made and I lose RecordContext, so I can't fill the fields on new Answer object.
The error is "Object reference not set to an instance of an object", but I think that the issue is making an AddIn that can pass the values of the fields in the CreateWorkspaceRecord or make an AddIn that (when new Answer is made) will not be in the Ribbon(so that AddIn won't be in infinite loop after clicking its button).