Editing SQL tables in Word templates

You can use the Mail Merge Field editor to edit new and existing Infor CRM SLX Table merge fields. When you select a Table merge field from the list pane view, the edit options are displayed in the edit pane. A Table merge field creates a table with merged content as defined in the SQL query. The Opportunity Table field is also a table field.
Note:  This feature is not available in the Infor CRM SLX Web Client. It is only available in Microsoft Word after installing Infor CRM SLX Mail Merge for Microsoft Word. For more information, see Installing Infor CRM SLX Mail Merge For Microsoft Word.

To edit an Infor CRM SLX table field:

  1. Select the required Infor CRM SLX table field, on the Mailings tab and click Edit Fields to edit an existing Infor CRM SLX table in an Infor CRM SLX mail merge template.
    Note: To add an Infor CRM SLX table to an Infor CRM SLX mail merge template, click Insert Field and click Table on the Mailings tab.
  2. Edit or complete these fields:
    • Field Identifier

      Used to change the text that displays in the template.

    • SQL
      Type the SQL query in the field or click Ellipsis to access the Edit SQL window to insert parameters or execute SQL to test the statement. For more information, see Editing SQL Value Fields in Word Templates
      • If editing a Table: The sample SQL query provides the appropriate format for inserting a table. Change the query to list the (SELECT) field(s) you require to include as the columns and (FROM) the table that contains those fields, and then define the (WHERE) statement to identify which records to include in the table. SELECT NAMEPFL FROM CONTACT WHERE CONTACTID = :ContactID
      • If editing an Opportunity Product Table: The sample SQL query provides the appropriate format for inserting a table with opportunity product information. SELECT A2.NAME, A1.PRICE, A1.DISCOUNT AS DISCOUNT, A1.CALCPRICE , A1.QUANTITY, A1.EXTENDEDPRICE FROM sysdba.OPPORTUNITY_PRODUCT A1 INNER JOIN sysdba.PRODUCT A2 ON A1.PRODUCTID = A2.PRODUCTID WHERE(A1.OPPORTUNITYID = :OpportunityID) ORDER BY A1.SOR
      Note: 
      • You must separate multiple SELECT items with commas (,).
      • After editing the SQL statement, if prompted to save modified properties, click Yes to save your changes, or No to discard your SQL changes.
      • If prompted to update the table heading columns, click Yes to access the Edit Table Columns window and automatically update the columns listed to match the SQL query. The table columns must match SQL query to ensure the table displays data as expected.
    • Table Format

      Click the arrow and select from a list of available table styles.

    • Option

      Used to apply properties to a table format, such as borders, colors, shading, and others.

    • Auto Fit
      Used to set auto fit properties to the table. Options include:
      • Based on the width of the document window.
      • Based on the contents of the table cells
    • Edit Table Columns

      Used to edit table column captions, width, and alignment. Click the Edit Table Columns button to open the Edit Columns window. For more information, see Editing Columns in Word template tables.

  3. Click OK.