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. In Microsoft Word, do one of the following:
    • To edit an existing Infor CRM SLX table in an Infor CRM SLX mail merge template, select the Infor CRM SLX table field, on the Mailings tab, click Edit Fields.
    • To add an Infor CRM SLX table to an Infor CRM SLX mail merge template, on the Mailings tab, click Insert Field and then click Table.
  2. Edit or complete the following:
    • Field Identifier

      Allows you to change the text that appears in the template.

    • SQL
      In the box, type the SQL query, or click the ellipsis button to open 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 want 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 open 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 drop-down arrow and select from a list of available table styles.

    • Option

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

    • Auto Fit
      Allows you 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

      Allows you 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.