I asked the same question. We are "crying" for that solution, because our project require info which PDF template is linked for custom form. Unfortunately, answer from this Slack community it is not possible. Custom form table (record) seems not to be scriptable 😔