increment custom field

guys,

im curious if there is a way to increment a device’s custom field from a function (once probing fails, it increments custom field by 1)

which then mean another device can increment that same custome field (as its generic)