<?xml version="1.0" encoding="utf-8"?>
<ManualTopic ID="/baanerp/td/onlinemanual/000430" xml:lang="en">
   <Header>
      <Title>CRM – Text
		Editor</Title>
      <Keyword type="header" order="d1e1630301">
         <Level1>CRM</Level1>
         <Level2>text editor</Level2>
      </Keyword>
   </Header>
   <AimSection ID="aim_crm_text_editor">
      <Paragraph>If you create a letter or a selection expression, you can use
		the Text Editor to specify the actual layout of the letter or to specify an
		expression.</Paragraph>
   </AimSection>
   <Note>
      <SectionTitle>Note</SectionTitle>
      <List>
         <ListItem>You can specify letters in the <Link href="/baanerp/td/smi/tdsmi1150m000" role="session">Letters (tdsmi1150m000)</Link> session.</ListItem>
         <ListItem>You can specify selection expression in the <Link href="/baanerp/td/smi/tdsmi0170m000" role="session">Selections (tdsmi0170m000)</Link> session</ListItem>
      </List>
   </Note>
   <GeneralSection>
      <SectionTitle>To use the text editor</SectionTitle>
      <List>
         <ListIntro>The layout of a letter or a selection expression can be very
		  simple or quite complex. It can contain the following data:</ListIntro>
         <ListItemHead>Normal text</ListItemHead>
         <ListItem>For example, "We are excited...". You can use special
		  characters like ö or é but it is not possible to use print effects such as
		  bold, underscore, and different fonts.</ListItem>
         <ListItemHead>Table fields</ListItemHead>
         <ListItem>You can use all table fields recorded in the <Link href="/baanerp/td/smi/tdsmi0182m000" role="session">Tables to be Displayed in CRM (tdsmi0182m000)</Link> session, such as
		  tccom100.nama (the business partner's name).</ListItem>
         <ListItemHead>Attributes</ListItemHead>
         <ListItem>You can use all attributes recorded in the <Link href="/baanerp/td/smi/tdsmi0550m000" role="session">Attributes (tdsmi0550m000)</Link> session. For more information, refer to <Link href="/baanerp/td/onlinemanual/000431" role="manual">
               <GUIRef href="/baanerp/crm" role="package">CRM</GUIRef> – attributes in the Text Editor</Link>.</ListItem>
         <ListItemHead>Predefined variables</ListItemHead>
         <ListItem>For example, @today (gives current date). For more information, refer to <Link href="/baanerp/td/onlinemanual/000432" role="manual">
               <GUIRef href="/baanerp/crm" role="package">CRM</GUIRef> – predefined variables in the Text Editor</Link>.</ListItem>
      </List>
      <Paragraph>It is recommended that you zoom and select table fields and
		attributes rather than entering them, because you are less likely to make
		mistakes by selecting them. On the <GUIRef href="" role="menu">Options</GUIRef> menu of the Text Editor, click <GUIRef href="" role="manual" Update="No">Start Zoomsession</GUIRef> to retrieve the required table
		fields or <Link href="/baanerp/td/glossary/glossary#FeaturDefini_td" role="glossary">attributes</Link>.</Paragraph>
      <Note>
         <SectionTitle>Note</SectionTitle>
         <Paragraph>Any text that you type after the pipe ( | ) symbol is not used
		  as programming code, but is merely used as additional information for the
		  user.</Paragraph>
      </Note>
   </GeneralSection>
   <GeneralSection>
      <SectionTitle>Operators in the Text Editor</SectionTitle>
      <Paragraph>You can use arithmetic, logical, or relational operators in the
		Text Editor.</Paragraph>
      <TABLE border="1" borderstyle="default" space-and-orientation="indented-estimated">
         <TBODY noTR="7">
            <TR no="1" isLast="false">
               <TH colspan="2" width="260" rowspan="1">Arithmetic
				operators</TH>
            </TR>
            <TR no="2" isLast="false">
               <TD width="19" rowspan="1" colspan="1">*</TD>
               <TD width="237" rowspan="1" colspan="1">multiplication</TD>
            </TR>
            <TR no="3" isLast="false">
               <TD width="19" rowspan="1" colspan="1">/</TD>
               <TD width="237" rowspan="1" colspan="1">division</TD>
            </TR>
            <TR no="4" isLast="false">
               <TD width="19" rowspan="1" colspan="1">+</TD>
               <TD width="237" rowspan="1" colspan="1">addition</TD>
            </TR>
            <TR no="5" isLast="false">
               <TD width="19" rowspan="1" colspan="1">-</TD>
               <TD width="237" rowspan="1" colspan="1">subtraction</TD>
            </TR>
            <TR no="6" isLast="false">
               <TD width="19" rowspan="1" colspan="1">¥</TD>
               <TD width="237" rowspan="1" colspan="1">remainder after division</TD>
            </TR>
            <TR no="7" isLast="true">
               <TD width="19" rowspan="1" colspan="1">&amp;</TD>
               <TD width="237" rowspan="1" colspan="1">linking strings (alphanumerical arrays)</TD>
            </TR>
         </TBODY>
      </TABLE>
      <Paragraph/>
      <TABLE border="1" borderstyle="default" space-and-orientation="indented-estimated">
         <TBODY noTR="4">
            <TR no="1" isLast="false">
               <TH width="263" rowspan="1" colspan="1">Logical
				operators</TH>
            </TR>
            <TR no="2" isLast="false">
               <TD width="263" rowspan="1" colspan="1">or</TD>
            </TR>
            <TR no="3" isLast="false">
               <TD width="263" rowspan="1" colspan="1">and</TD>
            </TR>
            <TR no="4" isLast="true">
               <TD width="263" rowspan="1" colspan="1">not
				(negation)</TD>
            </TR>
         </TBODY>
      </TABLE>
      <Paragraph/>
      <TABLE border="1" borderstyle="default" space-and-orientation="indented-estimated">
         <TBODY noTR="7">
            <TR no="1" isLast="false">
               <TH colspan="2" width="263" rowspan="1">Relational
				operators</TH>
            </TR>
            <TR no="2" isLast="false">
               <TD rowspan="1" colspan="1">=</TD>
               <TD width="241" rowspan="1" colspan="1">equal
				to</TD>
            </TR>
            <TR no="3" isLast="false">
               <TD rowspan="1" colspan="1">&lt;&gt;</TD>
               <TD width="241" rowspan="1" colspan="1">unequal
				to</TD>
            </TR>
            <TR no="4" isLast="false">
               <TD rowspan="1" colspan="1">&gt;</TD>
               <TD width="241" rowspan="1" colspan="1">greater
				than</TD>
            </TR>
            <TR no="5" isLast="false">
               <TD rowspan="1" colspan="1">&lt;</TD>
               <TD width="241" rowspan="1" colspan="1">less
				than</TD>
            </TR>
            <TR no="6" isLast="false">
               <TD rowspan="1" colspan="1">&gt;=</TD>
               <TD width="241" rowspan="1" colspan="1">greater than or equal
				to</TD>
            </TR>
            <TR no="7" isLast="true">
               <TD rowspan="1" colspan="1">&lt;=</TD>
               <TD width="241" rowspan="1" colspan="1">less than or equal
				to</TD>
            </TR>
         </TBODY>
      </TABLE>
   </GeneralSection>
   <GeneralSection>
      <SectionTitle>Functions in the Text Editor</SectionTitle>
      <List>
         <ListIntro>You can use the following functions in the Text
		  Editor:</ListIntro>
         <ListItem>Arithmetic</ListItem>
         <ListItem>Trigonometric</ListItem>
         <ListItem>Logarithmic</ListItem>
         <ListItem>String</ListItem>
         <ListItem>Date</ListItem>
      </List>
      <TABLE border="1" borderstyle="default" space-and-orientation="indented-estimated">
         <TBODY noTR="10">
            <TR no="1" isLast="false">
               <TH colspan="2" width="350" rowspan="1">Arithmetic
				functions</TH>
               <TH width="261" rowspan="1" colspan="1">Example</TH>
            </TR>
            <TR no="2" isLast="false">
               <TD width="113" rowspan="1" colspan="1">round
				(X,Y,Z)</TD>
               <TD width="233" rowspan="1" colspan="1"> 
                  <Paragraph>produces rounded value of X</Paragraph> 
                  <Paragraph>Y is number of decimals</Paragraph> 
                  <Paragraph>Z is rounding method (0 = down, 1 = normal, 2 = up)</Paragraph>
               </TD>
               <TD width="261" rowspan="1" colspan="1">-</TD>
            </TR>
            <TR no="3" isLast="false">
               <TD width="113" rowspan="1" colspan="1">val (A)</TD>
               <TD width="233" rowspan="1" colspan="1">produces numeric value of string A</TD>
               <TD width="261" rowspan="1" colspan="1">val ("8.7")
				= 8.7</TD>
            </TR>
            <TR no="4" isLast="false">
               <TD width="113" rowspan="1" colspan="1">abs (X)</TD>
               <TD width="233" rowspan="1" colspan="1">calculates
				absolute value of X</TD>
               <TD width="261" rowspan="1" colspan="1">abs (-10.3) = 10.3</TD>
            </TR>
            <TR no="5" isLast="false">
               <TD width="113" rowspan="1" colspan="1">int (X)</TD>
               <TD width="233" rowspan="1" colspan="1">produces integer value of X</TD>
               <TD width="261" rowspan="1" colspan="1">int (11.6) = 11</TD>
            </TR>
            <TR no="6" isLast="false">
               <TD width="113" rowspan="1" colspan="1">pow (X, Y)</TD>
               <TD width="233" rowspan="1" colspan="1">raises X to the power of Y</TD>
               <TD width="261" rowspan="1" colspan="1">pow (10.2) =
				100</TD>
            </TR>
            <TR no="7" isLast="false">
               <TD width="113" rowspan="1" colspan="1">sqrt (X)</TD>
               <TD width="233" rowspan="1" colspan="1">produces square
				root of X</TD>
               <TD width="261" rowspan="1" colspan="1">sqrt (16) = 4</TD>
            </TR>
            <TR no="8" isLast="false">
               <TD width="113" rowspan="1" colspan="1">min
				(X, Y)</TD>
               <TD width="233" rowspan="1" colspan="1">produces smallest value of X and Y</TD>
               <TD width="261" rowspan="1" colspan="1">min (6, 10) = 6</TD>
            </TR>
            <TR no="9" isLast="false">
               <TD width="113" rowspan="1" colspan="1">max (X, Y)</TD>
               <TD width="233" rowspan="1" colspan="1">produces largest value of X and Y</TD>
               <TD width="261" rowspan="1" colspan="1">max (6, 10) =
				10</TD>
            </TR>
            <TR no="10" isLast="true">
               <TD width="113" rowspan="1" colspan="1">pi</TD>
               <TD width="233" rowspan="1" colspan="1">constant with value pi
				(3.1415926)</TD>
               <TD width="261" rowspan="1" colspan="1">-</TD>
            </TR>
         </TBODY>
      </TABLE>
      <Paragraph/>
      <TABLE border="1" borderstyle="default" space-and-orientation="indented-estimated">
         <TBODY noTR="4">
            <TR no="1" isLast="false">
               <TH colspan="2" width="622" rowspan="1">Trigonometric
				functions</TH>
            </TR>
            <TR no="2" isLast="false">
               <TD width="177" rowspan="1" colspan="1">sin (X), cos (X), tan (X)</TD>
               <TD width="441" rowspan="1" colspan="1">produces sine, cosine, or tangent of X</TD>
            </TR>
            <TR no="3" isLast="false">
               <TD width="177" rowspan="1" colspan="1">asin (X), acos (X), atan (X)</TD>
               <TD width="441" rowspan="1" colspan="1">produces arc sine,
				cosine, or tangent of X</TD>
            </TR>
            <TR no="4" isLast="true">
               <TD width="177" rowspan="1" colspan="1">hsin (X), hcos (X), htan
				(X)</TD>
               <TD width="441" rowspan="1" colspan="1">produces hyperbolic sine, cosine, or tangent of
				X</TD>
            </TR>
         </TBODY>
      </TABLE>
      <Paragraph/>
      <TABLE border="1" borderstyle="default" space-and-orientation="indented-estimated">
         <TBODY noTR="4">
            <TR no="1" isLast="false">
               <TH colspan="2" width="625" rowspan="1">Logarithmic
				functions</TH>
            </TR>
            <TR no="2" isLast="false">
               <TD width="177" rowspan="1" colspan="1">exp (X)</TD>
               <TD width="444" rowspan="1" colspan="1">raises e to
				the power of X</TD>
            </TR>
            <TR no="3" isLast="false">
               <TD width="177" rowspan="1" colspan="1">log (X)</TD>
               <TD width="444" rowspan="1" colspan="1">produces natural logarithm of X on the basis of e</TD>
            </TR>
            <TR no="4" isLast="true">
               <TD width="177" rowspan="1" colspan="1">log10 (X)</TD>
               <TD width="444" rowspan="1" colspan="1">produces logarithmic value of X on
				the basis of powers of 10</TD>
            </TR>
         </TBODY>
      </TABLE>
      <Paragraph/>
      <TABLE border="1" borderstyle="default" space-and-orientation="indented-estimated">
         <TBODY noTR="7">
            <TR no="1" isLast="false">
               <TH colspan="2" width="350" rowspan="1">String
				functions</TH>
               <TH width="268" rowspan="1" colspan="1">Example</TH>
            </TR>
            <TR no="2" isLast="false">
               <TD width="113" rowspan="1" colspan="1">edit
				(X,Y)</TD>
               <TD width="233" rowspan="1" colspan="1">formats numeric value X according to format Y</TD>
               <TD width="268" rowspan="1" colspan="1">edit (10.3, "ZZZ9V,99") = " 10,30"</TD>
            </TR>
            <TR no="3" isLast="false">
               <TD width="113" rowspan="1" colspan="1">str (X)</TD>
               <TD width="233" rowspan="1" colspan="1">puts numeric value in string</TD>
               <TD width="268" rowspan="1" colspan="1">str (10.3) = "10.3"</TD>
            </TR>
            <TR no="4" isLast="false">
               <TD width="113" rowspan="1" colspan="1">len (X)</TD>
               <TD width="233" rowspan="1" colspan="1">produces length of string X</TD>
               <TD width="268" rowspan="1" colspan="1">len ("abc") =
				3</TD>
            </TR>
            <TR no="5" isLast="false">
               <TD width="113" rowspan="1" colspan="1">strip (X)</TD>
               <TD width="233" rowspan="1" colspan="1">deletes spaces
				after last character</TD>
               <TD width="268" rowspan="1" colspan="1">strip ("A ") = "A"</TD>
            </TR>
            <TR no="6" isLast="false">
               <TD width="113" rowspan="1" colspan="1">pos (X,Y)</TD>
               <TD width="233" rowspan="1" colspan="1">produces position of string Y in
				string X from left</TD>
               <TD width="268" rowspan="1" colspan="1">-</TD>
            </TR>
            <TR no="7" isLast="true">
               <TD width="113" rowspan="1" colspan="1">rpos
				(X,Y)</TD>
               <TD width="233" rowspan="1" colspan="1">produces position of string Y in string X from
				right</TD>
               <TD width="268" rowspan="1" colspan="1">-</TD>
            </TR>
         </TBODY>
      </TABLE>
      <Paragraph/>
      <TABLE border="1" borderstyle="default" space-and-orientation="indented-estimated">
         <TBODY noTR="3">
            <TR no="1" isLast="false">
               <TH colspan="2" width="436" rowspan="1">Date
				functions</TH>
               <TH width="436" rowspan="1" colspan="1">Example</TH>
            </TR>
            <TR no="2" isLast="false">
               <TD width="177" rowspan="1" colspan="1">date
				()</TD>
               <TD width="255" rowspan="1" colspan="1">produces current date</TD>
               <TD width="255" rowspan="1" colspan="1">-</TD>
            </TR>
            <TR no="3" isLast="true">
               <TD width="177" rowspan="1" colspan="1">date (YYYY, MM, DD)</TD>
               <TD width="255" rowspan="1" colspan="1">produces date according to specified year (YYYY), month (MM), and
				day (DD)</TD>
               <TD width="255" rowspan="1" colspan="1">date (2008, 5, 1) = 1 May
				2008</TD>
            </TR>
         </TBODY>
      </TABLE>
   </GeneralSection>
   <RelatedTopics>
      <SectionTitle>Related topics</SectionTitle>
      <RelTopic>
         <Link href="/baanerp/td/onlinemanual/000431" role="manual">
            <GUIRef href="/baanerp/crm" role="package">CRM</GUIRef> – attributes in the Text Editor</Link>
      </RelTopic>
      <RelTopic>
         <Link href="/baanerp/td/onlinemanual/000432" role="manual">
            <GUIRef href="/baanerp/crm" role="package">CRM</GUIRef> – predefined variables in the Text Editor</Link>
      </RelTopic>
      <RelTopic>
         <Link href="/baanerp/td/onlinemanual/000433" role="manual">
            <GUIRef href="/baanerp/crm" role="package">CRM</GUIRef> – examples of selection expressions</Link>
      </RelTopic>
      <RelTopic>
         <Link href="/baanerp/td/onlinemanual/000422" role="manual">
            <GUIRef href="/baanerp/crm" role="package">CRM</GUIRef> – overview</Link>
      </RelTopic>
   </RelatedTopics>
</ManualTopic>