<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Workflow Custom Code to Associate an Invoice Record to a Deal Record in Data Hub</title>
    <link>https://community.hubspot.com/t5/Data-Hub/Workflow-Custom-Code-to-Associate-an-Invoice-Record-to-a-Deal/m-p/980911#M2335</link>
    <description>&lt;P&gt;The environment I'm working in is integrated with NetSuite using HubSpot's app. Invoices are created in NetSuite and sync back to HubSpot.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The current process only brings a Company association to the Invoice as the invoices aren't usually tied to opportunties within NetSuite (just Customer).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;We have a custom property that syncs over which currently contains the HubSpot Deal's name.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is it possible to write a custom code that would take the deal name from this custom property then associate it to the Deal record with the exact name match?&lt;/P&gt;</description>
    <pubDate>Thu, 23 May 2024 03:08:01 GMT</pubDate>
    <dc:creator>SupportW</dc:creator>
    <dc:date>2024-05-23T03:08:01Z</dc:date>
    <item>
      <title>Workflow Custom Code to Associate an Invoice Record to a Deal Record</title>
      <link>https://community.hubspot.com/t5/Data-Hub/Workflow-Custom-Code-to-Associate-an-Invoice-Record-to-a-Deal/m-p/980911#M2335</link>
      <description>&lt;P&gt;The environment I'm working in is integrated with NetSuite using HubSpot's app. Invoices are created in NetSuite and sync back to HubSpot.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The current process only brings a Company association to the Invoice as the invoices aren't usually tied to opportunties within NetSuite (just Customer).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;We have a custom property that syncs over which currently contains the HubSpot Deal's name.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is it possible to write a custom code that would take the deal name from this custom property then associate it to the Deal record with the exact name match?&lt;/P&gt;</description>
      <pubDate>Thu, 23 May 2024 03:08:01 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/Data-Hub/Workflow-Custom-Code-to-Associate-an-Invoice-Record-to-a-Deal/m-p/980911#M2335</guid>
      <dc:creator>SupportW</dc:creator>
      <dc:date>2024-05-23T03:08:01Z</dc:date>
    </item>
    <item>
      <title>Re: Workflow Custom Code to Associate an Invoice Record to a Deal Record</title>
      <link>https://community.hubspot.com/t5/Data-Hub/Workflow-Custom-Code-to-Associate-an-Invoice-Record-to-a-Deal/m-p/981416#M2341</link>
      <description>&lt;P&gt;Hey &lt;SPAN style="background: var(--ck-color-mention-background); color: var(--ck-color-mention-text);"&gt;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/691258"&gt;@SupportW&lt;/a&gt;&lt;/SPAN&gt;, thank you for posting in our Community!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Yes, it is possible to write custom code that takes the Deal name from the custom property and associates the Invoice to the Deal record with the exact name match. &amp;nbsp;To our top experts, &lt;SPAN style="color:rgb(0,145,174);font-size:12px;"&gt;&lt;STRONG&gt;&lt;SPAN style="background: var(--ck-color-mention-background); color: var(--ck-color-mention-text);"&gt;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/630808"&gt;@james-portant&lt;/a&gt;&lt;/SPAN&gt;, and &lt;SPAN style="background: var(--ck-color-mention-background); color: var(--ck-color-mention-text);"&gt;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/737023"&gt;@aviafriat26&lt;/a&gt;&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/SPAN&gt; do you have any recommendations for &lt;SPAN style="background: var(--ck-color-mention-background); color: var(--ck-color-mention-text);"&gt;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/691258"&gt;@SupportW&lt;/a&gt;&lt;/SPAN&gt; matter?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you,&lt;/P&gt;
&lt;P&gt;Pam&lt;/P&gt;</description>
      <pubDate>Thu, 23 May 2024 19:48:28 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/Data-Hub/Workflow-Custom-Code-to-Associate-an-Invoice-Record-to-a-Deal/m-p/981416#M2341</guid>
      <dc:creator>PamCotton</dc:creator>
      <dc:date>2024-05-23T19:48:28Z</dc:date>
    </item>
    <item>
      <title>Re: Workflow Custom Code to Associate an Invoice Record to a Deal Record</title>
      <link>https://community.hubspot.com/t5/Data-Hub/Workflow-Custom-Code-to-Associate-an-Invoice-Record-to-a-Deal/m-p/981420#M2342</link>
      <description>&lt;P&gt;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/691258"&gt;@SupportW&lt;/a&gt;I've had a similar setup with HubSpot and NetSuite. You can definitely write some custom code to link those invoices to deals based on the deal name. Try this:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;&lt;STRONG&gt;Grab the Deal Name&lt;/STRONG&gt;: Pull the deal name from the custom property on the invoice.&lt;/LI&gt;
&lt;LI&gt;&lt;STRONG&gt;Find the Deal&lt;/STRONG&gt;: Search HubSpot for a deal that matches that name.&lt;/LI&gt;
&lt;LI&gt;&lt;STRONG&gt;Link Them Up&lt;/STRONG&gt;: If you find a matching deal, associate the invoice with it.&lt;/LI&gt;
&lt;/OL&gt;
&lt;P&gt;Here's a quick idea of what the code might look like:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;// Pseudo-code for custom workflow
// Get the deal name from the invoice's custom property
let dealName = invoice.customProperty; // Replace with how you actually get the custom property

// Search HubSpot for a deal with that name
let matchingDeal = hubspot.deals.search({ name: dealName }); // Replace with the real API call

// If you find a matching deal, associate the invoice with the deal
if (matchingDeal) {
  hubspot.invoices.associate(invoice.id, matchingDeal.id); // Replace with the real API call for association
} else {
  console.log('No matching deal found for invoice');
}
&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You'll need to tweak the API calls to fit your setup, but this should get you moving in the right direction.&lt;/P&gt;
&lt;P&gt;Hope this helps!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If anyone else has tips or tricks, jump in!&lt;/P&gt;</description>
      <pubDate>Thu, 23 May 2024 19:55:27 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/Data-Hub/Workflow-Custom-Code-to-Associate-an-Invoice-Record-to-a-Deal/m-p/981420#M2342</guid>
      <dc:creator>aviafriat26</dc:creator>
      <dc:date>2024-05-23T19:55:27Z</dc:date>
    </item>
    <item>
      <title>Re: Workflow Custom Code to Associate an Invoice Record to a Deal Record</title>
      <link>https://community.hubspot.com/t5/Data-Hub/Workflow-Custom-Code-to-Associate-an-Invoice-Record-to-a-Deal/m-p/983027#M2347</link>
      <description>&lt;P&gt;Thanks for the shout out&amp;nbsp;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/60427"&gt;@PamCotton&lt;/a&gt;. It looks like&amp;nbsp;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/737023"&gt;@aviafriat26&lt;/a&gt;&amp;nbsp;has got it sorted! &lt;span class="lia-unicode-emoji" title=":flexed_biceps:"&gt;💪&lt;/span&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 28 May 2024 10:32:36 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/Data-Hub/Workflow-Custom-Code-to-Associate-an-Invoice-Record-to-a-Deal/m-p/983027#M2347</guid>
      <dc:creator>james-portant</dc:creator>
      <dc:date>2024-05-28T10:32:36Z</dc:date>
    </item>
    <item>
      <title>Re: Workflow Custom Code to Associate an Invoice Record to a Deal Record</title>
      <link>https://community.hubspot.com/t5/Data-Hub/Workflow-Custom-Code-to-Associate-an-Invoice-Record-to-a-Deal/m-p/984283#M2353</link>
      <description>&lt;P&gt;Thank you for looping in these talents. I really appreciate everyone's support.&lt;/P&gt;</description>
      <pubDate>Thu, 30 May 2024 03:10:47 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/Data-Hub/Workflow-Custom-Code-to-Associate-an-Invoice-Record-to-a-Deal/m-p/984283#M2353</guid>
      <dc:creator>SupportW</dc:creator>
      <dc:date>2024-05-30T03:10:47Z</dc:date>
    </item>
    <item>
      <title>Re: Workflow Custom Code to Associate an Invoice Record to a Deal Record</title>
      <link>https://community.hubspot.com/t5/Data-Hub/Workflow-Custom-Code-to-Associate-an-Invoice-Record-to-a-Deal/m-p/984284#M2354</link>
      <description>&lt;P&gt;This is very helpful. Thank you!&lt;/P&gt;</description>
      <pubDate>Thu, 30 May 2024 03:11:04 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/Data-Hub/Workflow-Custom-Code-to-Associate-an-Invoice-Record-to-a-Deal/m-p/984284#M2354</guid>
      <dc:creator>SupportW</dc:creator>
      <dc:date>2024-05-30T03:11:04Z</dc:date>
    </item>
  </channel>
</rss>

