What drives your custom function to be executed automatically is a workflow rule. Go to Settings -> Automation -> Workflow Rules -> +New Workflow Rule and set the workflow up this way:
In the final step of the workflow, choose the custom function you created and then hit Save.
Now, you're good to go. Give it a whirl by converting a sales order that has attachments to a purchase order and verify if the attachments are carried through. Do note that any workflow or custom function created in Zoho Books will execute after the action of transaction creation only and not during. Therefore, look for the attachments after the PO is created.
Should you need any assistance on this, we're for you.
If you're liking this series so far and would like to get a Zoho Books routine of yours automated, dive right into the comments below. We'd love to hear from you.
Regards,
Divya R
Zoho Books