Script to update custom doctype

Hello, am seeking some help to create a custom script to update a custom doctype when a new item is created or update.
Example.
Create new item 1010. new item parent record gets inserted into custom doctype as a parent. the custom doctype is a table within the item doctype.

the custom doctype contains:

  • device
  • download status
  • upload status

the idea is when the record is downloaded to the device the device will change the status of the record to indicate record was downloaded so it can’t be downloaded again. when the user updates the record the status should change back to tell the device it can now download the record.

image

I know this might not be the best solution so I welcome any suggestion.

Do you have a custom endpoint which you provide to download the file? You can update the status there.

Also, in the on_update hook you can reset the status back to downloadable

I don’t understand. Where do I find the on_update hook?