You're almost there! Please answer a few more questions for access to the Applications content. Complete registration
Interested in joining? Complete your registration by providing Areas of Interest here. Register

Creating opportunity in a workspace contact

Received Response
4
Views
2
Comments
edited Feb 11, 2016 4:48PM in UI Extensibility 2 comments

Content

Hi everyone.

 

I created aa addin button in my workspace contact to get some data of it and create an opportunity but i've got an error.

Code Snippet

             IContact contactRecord = _recordContext.GetWorkspaceRecord(RightNow.AddIns.Common.WorkspaceRecordType.Contact) as IContact;
            IOpportunity opp = _globalContext.AutomationContext.CreateWorkspaceRecord(RightNow.AddIns.Common.WorkspaceRecordType.Opportunity) as IOpportunity;
            
            opp.Name = note;
            IOpp2Contact i2c = AddInViewsDataFactory.Create<IOpp2Contact>();
            i2c.Cid= contactRecord.ID;
            i2c.Prmry = true;
            opp.Contact.Add(i2c);

            contactRecord.NameLast = note;
            _recordContext.RefreshWorkspace(); 
        

Howdy, Stranger!

Log In

To view full details, sign in.

Register

Don't have an account? Click here to get started!