0 votes

Bonjour,

Je souhaitais créer un tableau dans un email instantané depuis une opportunité afin d'afficher les produits qu'elle contient.

La documentation des templates indique d'utiliser la fonction GetHtmlTable.

J'ai copié le tableau donné en exemple dans mon modèle d'email :

[$GetHtmlTable("Prod", entity="Prod", columndefs="HTML Columns",
columns="NAME,QUANTITY{CENTER},PRICE{NUMERIC},DISCOUNT{CENTER},
COMMENT,VAT,TOTAL{NUMERIC}", sum="TOTAL")]

L'obtient une erreur en exécutant ce template :
ID: CORE-1285
Message: Empty Column Definition File: HTMLColumns

Comment et ou renseigner ce fichier sur une version d'Efficy en mode cloud ?

Merci d'avance,
Joseph

asked in How to by (106 points)

1 Answer

+3 votes
Best answer

Dear Joseph,

You have to add the "HTML Columns" definition into the SYS_STORAGE table.

Here is an Example (I will call the columndefs "gridHTML")

So in Sys_Storage, add a Parameter called "gridHTML", with the following value (you can create your own)

starttable [<table border="1" style="width:700px;" cellspacing="0" cellpadding="2">]
endtable [</table><table border="0" width="100%" cellspacing="0" cellpadding="0"><%GetBorder("gray;white;/4")%></table>]

startheader [<tr class="GridHeader" id="hrow">]
endheader [</tr>]

startrow [<tr align="left" class="<#C:GridRow,GridRowAlt>" onMouseOver="this.className='GridRowHighLight'" onMouseOut="this.className='<#C:GridRow,GridRowAlt>'">] 
endrow [</tr>]

sumstartrow [<tr align=left>]
sumendrow [</tr>]
sumspacer [<td colspan=$COLUMNPOS$ class="Grid"> sumspacer</td>]
sumline [<td class="Grid"><hr>sumline</td>]
sumfield [<td class="Grid"><b><#F=$FIELD$></b></td>]
sumfield.CENTER [<td class="Grid" align="center"><b><#F=$FIELD$></b></td>]
sumfield.CURRENCY [<td class="Grid" align="right"><b><#F=$FIELD$;FORMAT=,0.00> €</b></td>]
sumfield.DURATION [<td class="Grid" align="right"><b><#F=$FIELD$;format=duration></b></td>]
sumfield.NUMERIC [<td class="Grid" align="right"><b><#F=$FIELD$></b></td>]
sumfield.PERCENTAGE [<td class="Grid" align="right"><b><#F=$FIELD$;FORMAT=,0.00>%</b></td>]
sum [<td class="Grid"><b><#F=$FIELD$></b></td>]
sum.CENTER [<td class="Grid" align="center"><b><#F=$FIELD$></b></td>]
sum.DURATION [<td class="Grid" align="right"><b><#F=$FIELD$;format=duration></b></td>]
sum.NUMERIC [<td class="Grid" align="right"><b><#F=$FIELD$></b></td>]
sum.CURRENCY [<td class="Grid" align="right" width="80px;"><b><#F=$FIELD$;FORMAT=,0.00> €</b></td>]

th [<th nowrap align="left"><#H=$FIELD$></th>]
td [<td class="Grid"><#F=$FIELD$></td>]
td.NUMERIC [<td class="Grid" align="right"><#F=$FIELD$></td>]
td.CURRENCY [<td class="Grid" align="right"><#F=$FIELD$;FORMAT=,0.00> €</td>]
td.PERCENTAGE [<td class="Grid" align="right"><#F=$FIELD$;FORMAT=,0.00>%</td>]

Then in the HTML Template you can use it as follow:

<p>
  [$GetHtmlTable('Prod', entity='Prod', columndefs='GridHTML', columns='NAME,PRICE{CURRENCY},QUANTITY{NUMERIC},VAT{PERCENTAGE},TOTAL{CURRENCY}')]
</p>
<p style="margin: 0cm 0cm 0pt;">
   
</p>
<table border="1" cellpadding="2" cellspacing="1" style="width: 700px;">
  <tbody>
    <tr>
      <td align="right" width="100%">
        <b>Total HT</b>
      </td>
      <td align="right" style="white-space: nowrap;">
        [$=DOCU.DOCU$INVOICING.TOTAL_NO_VAT,format='### ##0.00'] €
      </td>
    </tr>
    <tr>
      <td align="right">
        <b>Total TVA</b>
      </td>
      <td align="right" style="white-space: nowrap;">
        [$=DOCU.DOCU$INVOICING.TOTAL_VAT,format='### ##0.00'] €
      </td>
    </tr>
    <tr>
      <td align="right">
        <b>Total TTC</b>
      </td>
      <td align="right" style="white-space: nowrap;">
        [$=DOCU.DOCU$INVOICING.TOTAL_WITH_VAT,format='### ##0.00'] €
      </td>
    </tr>
  </tbody>
</table>
answered by (1.9k points)
selected by
Thanks a lot Stéphane ! This works perfectly.

Joseph
Merci Stéphane !  cette solution fonctionne super.
Dommage que ceci n'est pas présent dans EDN
Welcome to Efficy Overflow, where you can ask questions and receive answers from other members of the community.
1,249 questions
1,521 answers
1,859 comments
328 users