I have created a field ‘ClientID’ with an auto-increment on the relations (new field in studio and a trigger in the DB). That works perfectly. I now create invoices with a combination of the invoice title and the auto-increment value by using
$billing_account_klantnummer_c-$aos_invoices_name
This works perfectly. However, the PDF that’s being created only shows the aos_invoices_name. That’s because of this in generatePdf.php
Well, you just need a way to reference it. That depends on what module it exists (is billing_account a custom module you created?), and what is the relationship between the invoice module and that one.
But it should be simple Bean stuff.
Another approach would be if you could get that full name into one of the invoice fields (like description, for example) and then get it directly from the invoice Bean.
Sorry for my late reply! As far as I know billing_account is not a custom module. It’s the relation module. So there is already a relation. The klantnummer is a custom field, so that’s in accounts_cstm.
In my invoice I have in one column “Invoicename” and in the other column $billing_account_klantnummer_c-$aos_invoices_name (I wanted to attach it but neither on Chrome nor on Safari does the Add File button work, so please see https://imgur.com/a/Desu3)
I have no clue whatsoever how to get that name in the .pdf generator.
Maybe you need to get some help from a PHP developer. If you could use a debugger and check all the fields available in that bean, you would get it quickly.
If you want to explore anyway, try this from your SuiteCRM root directory:
grep -irn 'billing_account_klantnummer_c'
… and try to figure out how that field is called in the Bean, and in which module it exists.