Skip to main content
Question

Limiting number of elements (lines) in inserted and Deleted array of push notification data


Hello,
I’ve configured a Generic Inquiry for invoices and memos screen and a push notification of type of webhook to receive data change events to my external system . Acumatica is Sending the evnet data but the notification data is having multiple elements (lines) in the inserted and deleted arrays. I would like to limit the number of elements (lines) to be send via push notification since I’m facing push notification  failures due to data size. Kindly request to assist me on fixing this issue.
Example push notification data:
{

  “Inserted”: e

    {“ReferenceNbr”: “AR0001”},{“ReferenceNbr”: “AR0002”}

  ],

  “Deleted”: >],

  “query”: “Generic inquiry name”

}

6 replies

Userlevel 6
Badge +2

Hi @abhijithhari26 

It sounds like you need a pagination mechanism. However, GI doesn’t have pagination by default, so I’d tinker with GI parameters, that will allow you to filter results returned.

As another idea - create 2 GIs.
First will give you ReferenceNbrs that match your criteria (without other information to reduce the load).
Second will return data for a specific ReferenceNbr from Parameters.

It will require you to make more requests, but they will be more manageable.

Hi @andriitkachenko,
Thank you for the response. Actually I’ve created the GI to get data from a specific screen such as Invoices and memos monitoring through push notification. Everything is working fine as expected but, the push notification of webhook type configured monitoring  the specified GI for invoices and memos screen is sending multiple invoices data in one notification when I made a payment for multiple invoices. Due to this I would like to have a control on the number of invoices to be sent in one push notification to reduce the data size and comply with Acumatica guidelines not to exceed maximum size of 2 MB.

Userlevel 6
Badge +2

Hi @abhijithhari26     

I did some tinkering with the API requests to see how I can add a pagination.  
When you use GI as a source, you have to make REST API calls with  the PUT method, {} body and $expand=Result query parameters.  
$expand is an OData term, which should support $expand=Result($top=1). However, for me, it was always returning an error that this is an invalid term.  
You can’t also add $top as a top-tier argument, because it will be applied to the top-tier entity collection, which holds only 1 record anyway.  

With that in mind, what I can suggest to you is to:

1. Expose your GI to OData (Expose via OData checkbox in the Generic Inquiry screen)
2. Access data from the GI via OData protocol:  

GET http://localhost/instancename/odata/tenantname/inquiryname?$format=json&$top=5 
Authorization: Basic
{
Username: "admin"
Password: "123"
}

Don't forget to replace with your values:

  • instance name    
  • tenant name (if you have only one - remove this part of the URL)
  • inquiry name
  • username
  • password

By adding $skip and $top parameters you can pull as many records as you need at once.  
Hope it helps.  

Hello, In my case I would like to get the data through Acumatica push notification of type webhook feature which sends a post request to an external webhook API.  The data  sent in the post request by Acumatica push notification, I’m getting multiple invoices in Inserted array and Deleted array. The REST API may not be feasible in my case. Thank you.

Userlevel 7
Badge

Hi @abhijithhari26 were you able to find a solution? Thank you!

Hi @abhijithhari26 were you able to find a solution? Thank you!

Hi 

Hi @abhijithhari26 were you able to find a solution? Thank you!

Hi @Chris Hackett , I’m not able to find a solution to fix this , instead I’m modified my webhook API to handle multiple lines received in one push notification data from Acumatica ERP. however, we need to have a certain limit on the number of lines that Acumatica sends in one push notification data. if you have any suggestions or recommendations, please help me with this. Thanks.

 

Reply