Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Associate Contact with Existing Deal #44

Open
TimWhitbeck opened this issue Feb 19, 2019 · 5 comments
Open

Associate Contact with Existing Deal #44

TimWhitbeck opened this issue Feb 19, 2019 · 5 comments
Assignees
Labels
1.0.0 bug Something isn't working enhancement New feature or request

Comments

@TimWhitbeck
Copy link

I can create a new deal with a contact, that works great but when attempting to use the deal update and try to add a contact I am missing something.

code snippet:
var deal=api.Deal.GetById(dealId);
var contact = api.Contact.GetByEmail(contact.Email);
deal.Associations.AssociatedContacts=new []{contact.Id.Value};
api.Deal.Update(deal);
This succeeds but when I check hubspot there is no associated contact

@Psypher9
Copy link
Member

Hi! What version of HubSpot.NET are you using?

@TimWhitbeck
Copy link
Author

0.6.17

@Psypher9 Psypher9 self-assigned this Jun 9, 2019
@Psypher9 Psypher9 added 1.0.0 enhancement New feature or request bug Something isn't working labels Jun 9, 2019
@Psypher9
Copy link
Member

Psypher9 commented Jun 9, 2019

Hi @TimWhitbeck, I think that I will try to add an easier way to associate the contacts with the deal. Possibl add a dedicated method to the Deal. Thank you again for bringing this up!

@Psypher9
Copy link
Member

Psypher9 commented Jun 9, 2019

@ricktiger
Copy link

I coded it like this and it works.

DealHubSpotModel deal = HsAPI.Deal.Create(new DealHubSpotModel()
{
Associations = { AssociatedContacts = new[] { lHsVid } }, /* lHsVid is Contact Vid */
Name = "Super Product"
});
lDealid = (long)deal.Id; // Get back deal.id

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
1.0.0 bug Something isn't working enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants