Automate "Record Peyment"

Automate "Record Peyment"

Is it possible to automate the "Record Payment" action, when a invoice is sent ?