back to knowledgebase

How do I add product rows to a Sales Order, Quote, Invoice or Purchase Order Rich Text Document (RTF)?

Updated: 28 February 2019 13:58:19 OpenCRM::Quotes OpenCRM::Orders::Sales Orders OpenCRM::Orders::Purchase Orders OpenCRM::Invoice

It is possible to do this, but it should only be undertaken by someone with HTML and CSS knowledge.

First, you will want to build the document template as normal. Then you have an option about how you wish to add your products to your document.

Product Row Tags

To add a product table add the following tag:

START_PRODUCT_ROWS

You can then add the code that you wish to repeat for each linked product.

Then at the end of this code, add:

END_PRODUCT_ROWS

Using Tables

This is a little more complicated if you are using a table for the product grids. In this situation, insert the table as normal into the RTF document.

You will then need to edit the RTF document in Notepad, and manually put the two tags around the opening and ending tags for the product rows...

Here's some example code with the start and end row tags highlighted:

>{\rtf1\ansi\deff0\adeflang1025
{\fonttbl{\f0\froman\fprq2\fcharset0 Times New Roman;}{\f1\froman\fprq2\fcharset0 Times New Roman;}{\f2\fswiss\fprq2\fcharset0 Arial;}{\f3\froman\fprq2\fcharset0 Times New Roman;}{\f4\fnil\fprq2\fcharset0 SimSun;}{\f5\fnil\fprq0\fcharset0 Mangal;}}
{\colortbl;\red0\green0\blue0;\red128\green128\blue128;}
{\stylesheet{\s1\rtlch\afs24\lang1081\ltrch\dbch\af4\langfe2052\hich\fs24\lang2057\loch\fs24\lang2057\snext1 Normal;}
{\s2\sb240\sa120\keepn\rtlch\af2\afs28\lang1081\ltrch\dbch\af0\langfe2052\hich\f2\fs28\lang2057\loch\f2\fs28\lang2057\sbasedon1\snext3 Heading;}
{\s3\sa120\rtlch\afs24\lang1081\ltrch\dbch\af4\langfe2052\hich\fs24\lang2057\loch\fs24\lang2057\sbasedon1\snext3 Body Text;}
{\s4\sa120\rtlch\afs24\lang1081\ltrch\dbch\af4\langfe2052\hich\fs24\lang2057\loch\fs24\lang2057\sbasedon3\snext4 List;}
{\s5\sb120\sa120\rtlch\af5\afs24\lang1081\ai\ltrch\dbch\af4\langfe2052\hich\fs24\lang2057\i\loch\fs24\lang2057\i\sbasedon1\snext5 caption;}
{\s6\rtlch\afs24\lang1081\ltrch\dbch\af4\langfe2052\hich\fs24\lang2057\loch\fs24\lang2057\sbasedon1\snext6 Index;}
{\s7\sb120\sa120\rtlch\afs24\lang1081\ai\ltrch\dbch\af4\langfe2052\hich\fs24\lang2057\i\loch\fs24\lang2057\i\sbasedon1\snext7 caption;}
{\s8\rtlch\afs24\lang1081\ltrch\dbch\af4\langfe2052\hich\fs24\lang2057\loch\fs24\lang2057\sbasedon1\snext8 Table Contents;}
}
{\info{\author Phil Marsay}{\creatim\yr2010\mo12\dy9\hr17\min37}{\revtim\yr0\mo0\dy0\hr0\min0}{\printim\yr0\mo0\dy0\hr0\min0}{\comment StarWriter}{\vern3200}}\deftab709
{\*\pgdsctbl
{\pgdsc0\pgdscuse195\pgwsxn11906\pghsxn16838\marglsxn1134\margrsxn1134\margtsxn1134\margbsxn1134\pgdscnxt0 Standard;}}
{\*\pgdscno0}\paperh16838\paperw11906\margl1134\margr1134\margt1134\margb1134\sectd\sbknone\pgwsxn11906\pghsxn16838\marglsxn1134\margrsxn1134\margtsxn1134\margbsxn1134\ftnbj\ftnstart1\ftnrstcont\ftnnar\aenddoc\aftnrstcont\aftnstart1\aftnnrlc
\pard\plain \ltrpar\s1\ql\rtlch\afs24\lang1081\ltrch\dbch\af4\langfe2052\hich\fs24\lang2057\loch\fs24\lang2057 {\rtlch \ltrch\loch\f0\fs24\lang2057\i0\b0 CRM_START_TEMPLATE}
\par \pard\plain \ltrpar\s1\ql\rtlch\afs24\lang1081\ltrch\dbch\af4\langfe2052\hich\fs24\lang2057\loch\fs24\lang2057
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang1081\ltrch\dbch\af4\langfe2052\hich\fs24\lang2057\loch\fs24\lang2057 {\rtlch \ltrch\loch\f0\fs24\lang2057\i0\b0 QUOTE_SUBJECT}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang1081\ltrch\dbch\af4\langfe2052\hich\fs24\lang2057\loch\fs24\lang2057
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang1081\ltrch\dbch\af4\langfe2052\hich\fs24\lang2057\loch\fs24\lang2057 {\rtlch \ltrch\loch\f0\fs24\lang2057\i0\b0 CONTACT_FIRSTNAME}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang1081\ltrch\dbch\af4\langfe2052\hich\fs24\lang2057\loch\fs24\lang2057
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang1081\ltrch\dbch\af4\langfe2052\hich\fs24\lang2057\loch\fs24\lang2057 {\rtlch \ltrch\loch\f0\fs24\lang2057\i0\b0 ACCOUNT_ACCOUNTNAME}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang1081\ltrch\dbch\af4\langfe2052\hich\fs24\lang2057\loch\fs24\lang2057
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang1081\ltrch\dbch\af4\langfe2052\hich\fs24\lang2057\loch\fs24\lang2057
\par\trowd\trql\trpaddft3\trpaddt55\trpaddfl3\trpaddl55\trpaddfb3\trpaddb55\trpaddfr3\trpaddr55\clbrdrt\brdrs\brdrw1\brdrcf1\clbrdrl\brdrs\brdrw1\brdrcf1\clbrdrb\brdrs\brdrw1\brdrcf1\cellx4819\clbrdrt\brdrs\brdrw1\brdrcf1\clbrdrl\brdrs\brdrw1\brdrcf1\clbrdrb\brdrs\brdrw1\brdrcf1\clbrdrr\brdrs\brdrw1\brdrcf1\cellx9638
\pard\intbl\pard\plain \intbl\ltrpar\s8\rtlch\afs24\lang1081\ltrch\dbch\af4\langfe2052\hich\fs24\lang2057\loch\fs24\lang2057 {\rtlch \ltrch\loch\f0\fs24\lang2057\i0\b0 PRODUCT_PRODUCTNAME}
\cell\pard\plain \intbl\ltrpar\s8\rtlch\afs24\lang1081\ltrch\dbch\af4\langfe2052\hich\fs24\lang2057\loch\fs24\lang2057 {\rtlch \ltrch\loch\f0\fs24\lang2057\i0\b0 PRODUCT_PRODUCTCODE}
\cell\row\pard \pard\plain \ltrpar\s1\ql\rtlch\afs24\lang1081\ltrch\dbch\af4\langfe2052\hich\fs24\lang2057\loch\fs24\lang2057
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang1081\ltrch\dbch\af4\langfe2052\hich\fs24\lang2057\loch\fs24\lang2057
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang1081\ltrch\dbch\af4\langfe2052\hich\fs24\lang2057\loch\fs24\lang2057
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang1081\ltrch\dbch\af4\langfe2052\hich\fs24\lang2057\loch\fs24\lang2057 {\rtlch \ltrch\loch\f0\fs24\lang2057\i0\b0 CRM_END_TEMPLATE}
\par }

At these two points, break out on to separate lines and insert the loop start and end tags, so you then have:

{\rtf1\ansi\deff0\adeflang1025
{\fonttbl{\f0\froman\fprq2\fcharset0 Times New Roman;}{\f1\froman\fprq2\fcharset0 Times New Roman;}{\f2\fswiss\fprq2\fcharset0 Arial;}{\f3\froman\fprq2\fcharset0 Times New Roman;}{\f4\fnil\fprq2\fcharset0 SimSun;}{\f5\fnil\fprq0\fcharset0 Mangal;}}
{\colortbl;\red0\green0\blue0;\red128\green128\blue128;}
{\stylesheet{\s1\rtlch\afs24\lang1081\ltrch\dbch\af4\langfe2052\hich\fs24\lang2057\loch\fs24\lang2057\snext1 Normal;}
{\s2\sb240\sa120\keepn\rtlch\af2\afs28\lang1081\ltrch\dbch\af0\langfe2052\hich\f2\fs28\lang2057\loch\f2\fs28\lang2057\sbasedon1\snext3 Heading;}
{\s3\sa120\rtlch\afs24\lang1081\ltrch\dbch\af4\langfe2052\hich\fs24\lang2057\loch\fs24\lang2057\sbasedon1\snext3 Body Text;}
{\s4\sa120\rtlch\afs24\lang1081\ltrch\dbch\af4\langfe2052\hich\fs24\lang2057\loch\fs24\lang2057\sbasedon3\snext4 List;}
{\s5\sb120\sa120\rtlch\af5\afs24\lang1081\ai\ltrch\dbch\af4\langfe2052\hich\fs24\lang2057\i\loch\fs24\lang2057\i\sbasedon1\snext5 caption;}
{\s6\rtlch\afs24\lang1081\ltrch\dbch\af4\langfe2052\hich\fs24\lang2057\loch\fs24\lang2057\sbasedon1\snext6 Index;}
{\s7\sb120\sa120\rtlch\afs24\lang1081\ai\ltrch\dbch\af4\langfe2052\hich\fs24\lang2057\i\loch\fs24\lang2057\i\sbasedon1\snext7 caption;}
{\s8\rtlch\afs24\lang1081\ltrch\dbch\af4\langfe2052\hich\fs24\lang2057\loch\fs24\lang2057\sbasedon1\snext8 Table Contents;}
}
{\info{\author Phil Marsay}{\creatim\yr2010\mo12\dy9\hr17\min37}{\revtim\yr0\mo0\dy0\hr0\min0}{\printim\yr0\mo0\dy0\hr0\min0}{\comment StarWriter}{\vern3200}}\deftab709
{\*\pgdsctbl
{\pgdsc0\pgdscuse195\pgwsxn11906\pghsxn16838\marglsxn1134\margrsxn1134\margtsxn1134\margbsxn1134\pgdscnxt0 Standard;}}
{\*\pgdscno0}\paperh16838\paperw11906\margl1134\margr1134\margt1134\margb1134\sectd\sbknone\pgwsxn11906\pghsxn16838\marglsxn1134\margrsxn1134\margtsxn1134\margbsxn1134\ftnbj\ftnstart1\ftnrstcont\ftnnar\aenddoc\aftnrstcont\aftnstart1\aftnnrlc
\pard\plain \ltrpar\s1\ql\rtlch\afs24\lang1081\ltrch\dbch\af4\langfe2052\hich\fs24\lang2057\loch\fs24\lang2057 {\rtlch \ltrch\loch\f0\fs24\lang2057\i0\b0 CRM_START_TEMPLATE}
\par \pard\plain \ltrpar\s1\ql\rtlch\afs24\lang1081\ltrch\dbch\af4\langfe2052\hich\fs24\lang2057\loch\fs24\lang2057
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang1081\ltrch\dbch\af4\langfe2052\hich\fs24\lang2057\loch\fs24\lang2057 {\rtlch \ltrch\loch\f0\fs24\lang2057\i0\b0 QUOTE_SUBJECT}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang1081\ltrch\dbch\af4\langfe2052\hich\fs24\lang2057\loch\fs24\lang2057
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang1081\ltrch\dbch\af4\langfe2052\hich\fs24\lang2057\loch\fs24\lang2057 {\rtlch \ltrch\loch\f0\fs24\lang2057\i0\b0 CONTACT_FIRSTNAME}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang1081\ltrch\dbch\af4\langfe2052\hich\fs24\lang2057\loch\fs24\lang2057
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang1081\ltrch\dbch\af4\langfe2052\hich\fs24\lang2057\loch\fs24\lang2057 {\rtlch \ltrch\loch\f0\fs24\lang2057\i0\b0 ACCOUNT_ACCOUNTNAME}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang1081\ltrch\dbch\af4\langfe2052\hich\fs24\lang2057\loch\fs24\lang2057
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang1081\ltrch\dbch\af4\langfe2052\hich\fs24\lang2057\loch\fs24\lang2057
\par
START_PRODUCT_ROWS
\trowd
\trql\trpaddft3\trpaddt55\trpaddfl3\trpaddl55\trpaddfb3\trpaddb55\trpaddfr3\trpaddr55\clbrdrt\brdrs\brdrw1\brdrcf1\clbrdrl\brdrs\brdrw1\brdrcf1\clbrdrb\brdrs\brdrw1\brdrcf1\cellx4819\clbrdrt\brdrs\brdrw1\brdrcf1\clbrdrl\brdrs\brdrw1\brdrcf1\clbrdrb\brdrs\brdrw1\brdrcf1\clbrdrr\brdrs\brdrw1\brdrcf1\cellx9638
\pard\intbl\pard\plain \intbl\ltrpar\s8\rtlch\afs24\lang1081\ltrch\dbch\af4\langfe2052\hich\fs24\lang2057\loch\fs24\lang2057 {\rtlch \ltrch\loch\f0\fs24\lang2057\i0\b0 REL_PRODUCT_PRODUCTNAME}
\cell\pard\plain \intbl\ltrpar\s8\rtlch\afs24\lang1081\ltrch\dbch\af4\langfe2052\hich\fs24\lang2057\loch\fs24\lang2057 {\rtlch \ltrch\loch\f0\fs24\lang2057\i0\b0 REL_PRODUCT_PRODUCTCODE}
\cell\row
END_PRODUCT_ROWS

\pard \pard\plain \ltrpar\s1\ql\rtlch\afs24\lang1081\ltrch\dbch\af4\langfe2052\hich\fs24\lang2057\loch\fs24\lang2057
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang1081\ltrch\dbch\af4\langfe2052\hich\fs24\lang2057\loch\fs24\lang2057
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang1081\ltrch\dbch\af4\langfe2052\hich\fs24\lang2057\loch\fs24\lang2057
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang1081\ltrch\dbch\af4\langfe2052\hich\fs24\lang2057\loch\fs24\lang2057 {\rtlch \ltrch\loch\f0\fs24\lang2057\i0\b0 CRM_END_TEMPLATE}
\par }

 

Troubleshooting: Fields are not merging in RTF Templates. Product grids or rows are not merging in RTF templates.

This is quite a common issue with RTF documents, which can be quite challenging to set up due to the high level of markup script which is inserted by most RTF editors.

To correct these issues, you usually need to look at the actual source code of the document. You can do this by opening the file up in Windows Notepad, or another basic text editor.

If you do not feel comfortable examining the code, please get in touch with our support team, they will be able to help.

 

The two most common errors are the result of fields or product grids not merging.

A field is not merging

Often this is because the RTF editor has placed some markup code within the tag itself. This will not be visible in the RTF editor, but can be seen when looking at the document in Notepad...

e.g.

You need to remove the characters encased in the tag:

After doing this, you should re-upload and test the RTF template.

If it does not look correct, you may need to go through a few iterations of editing the template in the RTF editor, correcting in Notepad, re-uploading and testing.

 

Product Grids are not merging

Firstly, you should check for the same problem explained above for the field name - check that no markup code has been placed within the tag.

Secondly, you need to ensure that the START_PRODUCT_ROWS and the END_PRODUCT_ROWS are not within any parenthesis for any other mark up.

For example, this below will not work because the tag is within other parenthesis...

The solution is to break this out so that it is on it's own:

After doing this, you should re-upload and test the RTF template.

If it does not look correct, you may need to go through a few iterations of editing the template in the RTF editor, correcting in Notepad, re-uploading and testing.

Rate This Article
  • 1 star
  • 2 star
  • 3 star
  • 4 star
  • 5 star
Feedback and Comments
captcha code  


You may also be interested in: