PDF Template - Custom formatting string in templateparser

Hi again Pgr,
I assure you, i use the account name !
I have made a screenshot…

Xavier
account_name_SCRM-Screenshot_20200908_212435

To exclude language issue with translation, i check in english also : the field is here too :
contactname-uk-Screenshot_20200908_225036

That just looks like a bug in the dropdowns. Do you see that field anywhere else in SuiteCRM? In a view? In Studio? What are those fields supposed to mean?

uh… i find a field name in account but not in contact… Is this a “calculated fields” (using the first and last name) existing in the dropdown ?
If there is no direct field, how this could show me the name of the person ???
So strange…

Thanks Pgr :slight_smile:
Xavier

Do you have a relate field called “billing”?

Hi Pgr,
No, no : this is the “core fields” used here…
I make some screenshot and i come back…
Xavier

Here it is :

This is filled during the quotation.
Xavier

Where is that? I don’t see it.

Check the online demo to see if it looks the same as your system:

https://www.softaculous.com/demos/SuiteCRM

And check your Studio and pay attention to any additional customizations: relationships, relate fields, new fields

Hi Pgr,
It is exactly the same thing on the demo : Quotes -> Create (on the demo), you have the exact same thing.

Thanks for your time :slight_smile:
Xavier

Ah, so you’re on Quotes module, not Accounts.

That field seems to be called

$aos_quotes_billing_account

Composed like this:

$key is aos_quotes

$focus->$fieldName is billing_account

Hi pgr,
Ok, i can now have my full parser wirking correctly.

One last question :
If i want to have a “table” build with several fields, i cannot no ?
Imagine something like :
table - tr - td firstfield /td td secondfield /td /tr /table
As one field is read on each loop, i cannot have several fields in the table with something like if field1 is filled, show field1 and field 2
I have tried to assign the value in a custom var in the code, but the value seems to be lost on each loop (tried static, global, etc…, no success : i have to parse fields one by one).

If you know a solution for this… :slight_smile:
Thanks for all your help done pgr !
By the way, if you know a solution for my other question here, please tell me !
Need some explanation on how works import inbound emails
and
Understanding also the email management
Thanks pgr :wink:
Xavier

Hi @Chabi02

Maybe you’ve solved this by now , but if you haven’t, or for others that have the same question :

Yes you can reference many other fields, provided you do not add them to the template. Only add one of the fields to the template (eg $firstfield). Then in templateParser.php only check for this field, and reference any other fields, eg

if ($name === 'firstfield') {
$value = "<p>".$value." - ".$repl_arr['secondfield']."</p>";}

Hi EugeneP,
This change a lot of thing indeed : if i had this information sooner, i would have create my templateparser differently :slight_smile:

Thanks for this information : i will try (not right now) this solution for other PDF.
Then, I could ask an other question : is this possible to indicate to the PDF a different parser file ?

Thanks to everybody, and especially to all who have helped me :slight_smile:
Xavier