I am trying to set up a workflow and custom function that will automatically make a transfer from a credit card account to a bank account in Zoho Books (the "bank" account is representing Plastiq, which is a payment service that will take a credit card payment and issue a check on my behalf to vendors).
The logic here is that when I make a Vendor Payment of the type Plastiq (which credits the Plastiq bank account), I want the workflow to run a custom function that will make a transfer to debit the Plastiq account the full amount of the transaction and credit the credit card account.
I'm using the following in my custom function:
- transfer = zoho.books.createRecord("banktransactions",org,payload);
- info transfer;
The org variable is my organization number, and the payload variable is a map with all of the parameters for the transaction.
When I execute, I get the following error:
- {"code":11016,"message":"Involved account types are not applicable"}
The transaction type I have specified is "transfer_fund". The account codes are hard-coded.
I can do this transaction via the UI, so I know it's possible. What am I missing here? I'm a total garbage scripter, so I'm sure it's something dumb I'm doing.
Any help would be appreciated!