Announcement

Collapse
No announcement yet.

Output of field in PDF print

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Output of field in PDF print

    I have several checkboxes (Boolean) in my entity. When I create a PDF-template the values are output as "True" and "False". Is it possible to convert the output as "Yes" and "No".

  • #2
    Meanwhile I succeded in resolving this. My tip for anybody searching for syntax, you have to search for "handlebars syntax", because templating in EspoCRM is provided by handlebars.js.

    As I am not a programmer I had to try lots of possibilities. Boolean values you can output via an if-condition. This condition does not allow expressions but only single values. First I thought, I would have to insert not only the field-name, but also the state (true/false or 1/0), but this did not work. I think this is, because a Boolean "is" or "is not", what means, when the checkbox is not clicked, this is already the state "is not". Because of this, you do not need an additional condition.

    Ok, so far my simple concluded explanation. The code to format the Boolean output has to look like the following:

    {{#if name}}
    Yes
    {{else}}
    No
    {{/if}}

    where "name" is the name of the respective field.

    Simple as that. I hope this will help others with similar problem.

    Comment


    • #3
      Is this present on the manual?

      Comment


      • #4
        No it is not

        Comment


        • #5
          yuri , It would be great to have this on Manual.

          Thanks

          Comment

          Working...
          X