When updating, make column data add existing value with new value

Hi guys, my first support topic here.

I’m trying to write a small application to help my friend do an inventory count once a year. There will be multiple mobile apps hitting the API at the same time, and I want to make sure the quantity of an item gets incremented correctly.

Is there a way to ensure that whenever an API call is made to update an item, the current quantity gets added to the provided quantity and have that sum be saved in the update?

I started to look at the beforeUpdate event handlers in the business logic, but I’m not sure how to get the current value of the item being updated so that I can add it to the value provided in the call parameters.

Thanks for any help or direction towards some example of similar actions anyone has previously accomplished.

Hi Jameson,

We have a service dedicated just right to such problems. Please check out the Atomic Counters API.

Thanks for you response.

Is there a limit for the number of counters?

It seems like I would have to set up a counter for each product quantity to solve the problem, which could be upwards of 1000 products.

No, currently there are no limits for counters.