Loading
システム管理者に対するフィッシング耐性MFA・全従業員ユーザーMFAの適用のお知らせ 続きを読む
Salesforce Document Generation
Token Naming Conventions for Context Service

Token Naming Conventions for Context Service

Use naming conventions to correctly insert image, hyperlink, rich text, and data true-up tokens in your document templates. Each token follows a specific format so that Context Service can identify the type of content and process it correctly during document generation.

Required Editions

Available in: Lightning Experience
Available in: Professional, Enterprise, Unlimited, and Developer Editions

Token Formats and Examples

In the document templates, the tokens reference the attributes that are defined in your context structure.

Token Type Required Token Format Required Fields Optional Fields Example Token Names Notes
Image IMG_<token>_src src height, width IMG_ProductImage_src, IMG_ProductImage_height The source field must contain a valid Salesforce Content Document ID or a file name. If multiple files match the name, the first one is used.
Hyperlink HYP_<token>_url url text HYP_ProductLink_url, HYP_ProductLink_text The URL field is required. The text field is optional and defines the label shown in the link.
Rich Text RTB_<token> RTB_ProductDescription The rich text content should be in HTML format. No additional fields are required.
Data True-Up (Live updates) DT_<token> DT_OpportunityAmount Used to update record field values with updated values from the document. Context Service automatically identifies the object, field, and value during processing. DT tokens are supported only for parent objects and work with DOCX templates. They don’t support child objects or PPTX templates.

How Token Parts Are Grouped

When multiple fields use the same base token name such as IMG_logo_src, IMG_logo_height, IMG_logo_width, Context Service groups them automatically under a single token key in the JSON. For example:

"IMG_logo": {
  "src": "0697x00000XYZ123",
  "height": "100",
  "width": "250"
}

Avoid Using Reserved Words

Don’t use reserved names such as Id and BusinessObjectType as tokens or attribute names in context definitions. Context Service replaces any reserved name with a system-generated value.

Key Terms

  • Token is a placeholder in your template that gets replaced with data during document generation.
  • Attribute is a defined data field in your context structure.
  • Field is the actual Salesforce data field being mapped.
 
読み込み中
Salesforce Help | Article