Skip to main content
Skip table of contents

23. Letter Templates: Creating Bookmarks

AppBase enables you to use templates for HTML Emails and/or Microsoft Word and use them in any AppBase application to populate fields in the template with specific content from your application. For example, you might use a New Customer Welcome Letter template to pull information from the BOM to create a PDF containing each customer’s information. The resulting letter could be placed in the CMS and work like any other file.


Steps

  1. Go to the Letter Generation application, notice that this is a different application from Home, Setup, or AppStudio that we were using in the previous exercises.
  2. Navigate to Bookmarks (1). Click on the green + Add 

    button to create a brand new bookmark that will be used in our templates.

  3. In the Create new Bookmark tab insert ‘APPLICANT_NAME’ for Name, select ‘Function’ for Type. Select ‘Case’ for Root Object Type.

  4. As you notice the field Value is already filled with an example SQL code. Replace that code for the following SQL query:

    SQL
    SELECT COL_CUSTOMER_NAME FROM TBL_CDM_AUTO_LOAN WHERE COL_CDM_AUTO_LOANCASE = @ObjectId@

    Validate that the name of the table and columns correspond to your MDM model.

  5. Save your configuration.

  6. After some seconds you will see a new Debug button next to General Information. Select Debug to check if the bookmark returns a valid value.

  7. In the Debug window insert a valid Object ID, in our sample that corresponds to a Case ID, click the Run button to test our new bookmark.

    Remember that in most of the default solutions you can identify the Object ID from the last digits in the Case name ID (CASE-YYYY-ID).

  8. Save your configuration and Close Window.

  9. Clone the APPLICANT_NAME bookmark to create more needed bookmarks.

  10. Use ‘APPLICANT_CREDIT_SCORE’ for the Name. Open the new bookmark to edit the SQL query and change the field COL_CUSTOMER_NAME for COL_CREDIT_SCORE.

    CODE
    SELECT COL_CREDIT_SCORE FROM TBL_CDM_AUTO_LOAN WHERE COL_CDM_AUTO_LOANCASE = @ObjectId@

  11. Repeat the previous step to add the following additional bookmark:
    Name: APPLICANT_LOAN_AMOUNT
    Value: SELECT COL_LOAN_AMOUNT FROM TBL_CDM_AUTO_LOAN WHERE COL_CDM_AUTO_LOANCASE = @ObjectId@

  12. After creating the bookmarks, you should have a list as follows:

Next Steps

24. Letter Templates: Creating Email Templates


JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.