QUESTION:
I’ve done many things like this before, but could you tell me maybe the best, easiest way to grab the invoice number of the form and use it as the name of the PDF. Can it be done some way by passing to the config.bbx alias similar to below versus from the rule set? Kinda looking for a “best practice” here.
Just using something like this alias in Pro5 as an example:
alias PP |"uf80c -f unform.rul -p pdf -o /home/pdfs/<invoicenum>.pdf" "PDF" CR,SPCOLS=190,SPLINES=64,CPCOLS=190,CPLINES=64
ANSWER:
You can do this two ways, and I don't think there is one way preferred over the other except that within an unform code block, there is more flexibility.
Using the alias example, you can use $NAME as a substitution value (NAME can be any word), with the substitution value(s) being passed via a mode= option in the BBx open statement. See their docs for this.
In UnForm, you can set output$ in a prejob code block to override the default output value. This of course can be set to any value you can calculate.
You can do a hybrid, by passing some value or values via the -prm command line option. These values can contain mode= substitutions.