Announcement

Collapse
No announcement yet.

PDF Template Formula using TeamNames?

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

  • PDF Template Formula using TeamNames?

    Hi, I use the latest version and also the Sales pack and have two different teams defined. If an invoice includes team 1, I would like to show a different logo in the pdf, compared to team 2. I know the basic template formulas but cannot figure out the right syntax to check if team 1 is part of the teamNames collection.

    Any idea?

    Thanks,

    Bernhard

    P.S. I I recently switched from version 6.1 to 7.4 and the Espo Team made fantastic improvements in the whole system. Thanks for a great job! Also, the Outlook integration works as needed. Thanks for all your efforts.

  • #2
    Hi Bernard,

    I suggest you add field specific for this purpose maybe boolean or enum. Using formula you then set the value of that field based on the teams, then using ifequal you can decide easily what to render.

    The following formula will help to determine the value of the field:

    Use this function https://docs.espocrm.com/administrat...#arrayincludes

    Code:
    ifThen(
        array\includes(teamsIds, 'some-value-2'),
        logo = 'logo1';
    );
    
    ifThen(
        array\includes(teamsIds, 'some-value-2'),
        logo = 'logo2';
    );​
    Last edited by eymen-elkum; 05-17-2023, 10:37 AM.
    CEO & Founder of Eblasoft.
    Professional EspoCRM development & extensions.

    Comment


    • #3
      Hi Eymen,

      thanks for your answer. Funny, I already tried the same using teamsNames, but this did not work. Using teamsIds as you suggested works great. Thanks for your help.

      Bernhard

      Comment

      Working...
      X