Jump to content

ARPYMT updates an ARInvoice, but is it SET (or update) considered for Smart Event?


 Share

Recommended Posts

Hello!

My very first post here and thanks a lot in advance for any possible help/suggestions.
I do appreciate it in advance!

DESCRIPTION:
I created a Smart Event where it sends an HTTP post every time when an Invoice "created" (Add) or "updated" (Set).
Every time an Invoice created my webhook endpoint is successfully receiving a Sage request. Works perfectly!

The problem is with Set: when I do "create ARPayment" through the API, it successfully updates specified invoice with paid amounts, state, etc. but looks like Smart Event isn't triggered that way.
However, If I do real update Invoice (not by create ARPayment) through API than yes, Smart Event triggered and my webhook endpoint receiving all needed data. 

QUESTION:
Do I miss something or everything sounds right where while "create ArPayment" does update an Invoice under the hood, Smart Event not considering it as Set method?

Thank you so much in advance again for any possible help here.


 

Link to comment
Share on other sites

  • Members

Alim,

Create the webhook smart event on the AR Payment object and pass the AR Payment record number. In you code then execute a "read" on that AR Payment record number.

This will give you the list of Invoices that were paid with that payment. Remember AR payment line items are the individual Invoices that are paid with that payment

Example:
 

<content>
 <function controlid="testControlId">
  <read>
    <object>ARPAYMENT</object>
    <fields>INVOICES</fields>
    <keys>5196</keys>
    <returnFormat>xml</returnFormat>
  </read>
 </function>
</content>

 

Link to comment
Share on other sites

 Share

×
×
  • Create New...