How to get field format into custom print format

Hey everyone,

I have probably a simple question (hopefully), but I’m struggeling with its solution:

I’ve added a custom (short text) field “custom_field” inside my sales invoice to have the possibility for an extra text block in my invoices.

When I try to use this field now in my print format:

{{doc.custom_field}}

I have the problem that the whole text is inserted as one line without any format/line breaks that I’ve added earlier.

Is there a way that the html formatting is recognized and done inside the print format/pdf as well as it is done before in the custom field?

Thanks in advance!

Hi @Nicolai_Knr,

Use it.

{{ doc.get_formatted('custom_field') }}

then reload and check it.

Thank You!

1 Like

This is working fine!
Input field (short text):
test_text
In print format I entered the following:

{{ doc.get_formatted('test_text') }}

And the pdf is showing me this:
grafik
As a short hint for others:
Make sure you write it exactly the same way - I forgot the single quotation marks around the field name and the short text wasn’t displayed at all (no error)!

Thank you very much for the fast response and your help!