Bookmarks work with Email Templates and Mail Merge Templates to replace Placeholders with static or dynamic content. 

Creating bookmarks

Bookmarks are intended to work with rules that return a single value, and it's designated output parameter is called ResultText of type Text. 

  1. Open Application Studio of your solution
  2. From the left menu, select Letter Templates -> Bookmarks
  3. Click on New Bookmark. The New Bookmark page displays.
  4. Enter the bookmark properties as follows:

    PropertyDescription
    Bookmark NameEnter meaningful names. This names displays when you are mapping Placeholders to Bookmarks, and identifies the Bookmark.
    API Permanent IDThis field is automatically prepopulated and needs to be unique across all Bookmarks in your solution.
    Bookmark Type

    Can be either Constant or a Rule.

    When selecting this option, you intend the the Bookmark to always return the same value.

    PropertyDescription
    Constant ValueThe value that you want this Bookmark to return.

    When selecting this option, you intend the Bookmark to return dynamic content that it gets from a rule. Since a Bookmark is used to replace a Placeholder, it needs to to map to a one output Parameter of a rule. The types of rules you can have is outlined here: Rule Usage and Type. When creating a new rule for a bookmark, you can set it's Rule Usage to Bookmark that will create the necessary output parameter. Your rule can have as many input parameters as needed.

    PropertyDescription
    RuleThe rule you want the Bookmark to get information from.
    Result MappingThe output parameter from the selected Rule that you want the Bookmark to return to your Placeholder.
    DescriptionEnter a meaningful description. This description should explain what information this Bookmark is intended to return.
  5. Click Save
Bookmark rule example
  1. From the left menu, select Business Rules -> Rules
  2. Click on New Rule. The New Rule page displays.
  3. Enter the specific rule properties as follows. To read about the other properties, review the Rules help:

    PropertyValueDescription
    Rule UsageBookmarkThis rule usage provides the necessary input and output parameters necessary for defining a Bookmark.
    Rule TypeNonQuery SQLThis type of rule is meant to return single output parameters instead of list of records. Click here to learn a about the different rule types that a Bookmark can be.
    Rule Body 

    Any valid NonQuery SQL code that fills out the ResultText output parameter. If I have a Business Object called Customer and I want to return back the FirstName + LastName, the code may look like:

    DECLARE
    	v_fname varchar(255);
        v_lname varchar(255);
    	
    BEGIN	
    	SELECT <%=Column("Customer","FirstName")%>, <%=Column("Customer","LastName")%>
            INTO v_fname, v_lname 
    	FROM <%=Table("Customer")%>
    	WHERE <%=Column("Customer","Id")%> = :Id;
    
           :ResultText :=CONCAT(CONCAT (v_fname, ' '),  v_lname);
    END;
  4. Click Save

Edit bookmark

  1. Open Application Studio of your solution
  2. From the left menu, select Letter Templates -> Bookmarks
  3. Click the  Edit button next to the Bookmark you want to modify.
  4. Update the Modify Bookmark page.
  5. Click Save

Delete bookmarks

  1. Open Application Studio of your solution
  2. From the left menu, select Letter Templates -> Bookmarks
  3. Click on  Delete button next to the Bookmark you want to delete. Alternatively, you can select multiple Bookmarks and select the With Selected Do toolbar button and then Delete.
  • No labels