Output of field in PDF print

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • shalmaxb
    Senior Member
    • Mar 2015
    • 1602

    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".
  • shalmaxb
    Senior Member
    • Mar 2015
    • 1602

    #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

    • rodrigocoelho
      Active Community Member
      • Jun 2016
      • 296

      #3
      Is this present on the manual?

      Comment

      • shalmaxb
        Senior Member
        • Mar 2015
        • 1602

        #4
        No it is not

        Comment

        • rodrigocoelho
          Active Community Member
          • Jun 2016
          • 296

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

          Thanks

          Comment

          Working...