There is a module for Drupal called Rules which may be able to help with this: https://drupal.org/project/rules - it allows you to configure trigger/event logic via the UI - no coding required.
See my comment in this related issue for more information: Schedule a log based on a quantity value
I’ve decided NOT to include Rules in farmOS 1.x because it does not have an automated upgrade path to Drupal 8, so it would add a hurdle to our upgrade process. If you self-host farmOS you are welcome to install it and play around - just know that it may need to be redone when we migrate to farmOS 2.x
Alternatively, it would be relatively simple to code this in a custom module using hook_entity_insert()
: https://api.drupal.org/api/drupal/modules!system!system.api.php/function/hook_entity_insert/7.x
Something like:
/**
* Implements hook_entity_insert().
*/
function mymodule_entity_insert($entity, $type) {
// If this is a purchase log, create an asset.
if ($type == 'log' && $entity->type = 'farm_purchase') {
$asset = array(
'name' => 'My Asset',
'type' => 'equipment',
);
farm_asset_save($asset);
}
}