Contract PDF Template, called from the contract screen.
I’ve checked, and other variables like $aos_contracts_start_date and $aos_contracts_status do populate properly (under 7.11.23, anyway, but I don’t have any reason to suspect a regression).
So, I expected that the reference code was a unique value (DB key value or something). But it wasn’t visible on the views, so I couldn’t see it.
I’ve added it to the views through Studio, and the field is empty, which is why the variable isn’t being filled in. So that part of the mystery is solved.
Now I just need to figure out how to autogenerate a serial number and combine this with a related field to produce the unique ID.
If your id can be ugly, you can use the id field which is the GUID used in the database.
If you need more of a serial-number-presentable-to-a-customer, you might need to create an auto_increment field, there are several posts here in the Forums about that, for example:
I am the author of a paid add-on that greatly enhances template capabilities, it’s called PowerReplacer. That can also be used to facilitate automatic numbering and many other things.
There’s a reason why I went ahead and re-wrote the whole thing
People always need more than what the system provides…
So… the system variables: sorry, no, I don’t think they’re available. Sometimes you can create clever schemes of putting things in fields so that you can access them in the templates.
About the complete list of fields; again, no, there isn’t, although there are a couple of ways that can get you close enough. One is the database schema which is available online:
Where you can browse tables and fields. And relationships.
Then there are the vardefs files throughout the directory tree of SuiteCRM, with all the fields defined in there. This is basically what you see in Studio, although in Studio you have to click on each field individually to see the internal name.