Loading
Salesforce Document Generation
Innehållsförteckningar
Välj filter

          Inga resultat
          Inga resultat
          Här är några söktips

          Kontrollera stavningen av dina nyckelord.
          Använd mer allmänna söktermer.
          Välj färre filter för att utöka din sökning.

          Sök hela Salesforce-hjälpen
          Transform Context Data for Document Generation

          Transform Context Data for Document Generation

          A DocGen transformation is how you prepare data before a document is generated. You can reshape flat data into hierarchies, group related records, and derive the values a template should show such as, nesting products under a bundle or calculating totals. The Data Processing Engine (DPE) uses a context definition to run that logic and output structured JSON; document generation then reads that JSON to fill the template. Together, the transformation step closes the gap between source records and a predictable structure for the template.

          Required Editions

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

          Key Capabilities

          • Hierarchy: Represent bundle hierarchies and group relationships by using parent-child structures, supporting up to five levels of nesting. For example, group accessories such as Mouse and Keyboard under a parent product such as laptop.
          • Multilevel hierarchy: Build hierarchical structures across related objects, such as Quote → Quote Line Group → Quote Line Item, or across multiple levels, such as Region, Country, and City.
          • Grouping: Group records based on attributes or conditions, such as Selling Model Type, to organize data into categorized sections.
          • Default values: Apply default values for missing fields, such as image height and width, when they aren’t provided in source data. This ensures consistent rendering in the generated document.
          • Formula-based transformation: Calculate derived values by using formulas, such as total price from Quantity and Unit Price, or format values before showing them in the document.

          Steps Involved in DocGen Transformation

          Complete these steps in a sequence.

          • Create a context definition to model your data.
          • Select the Is Transform Available checkbox to turn on transformation, and then configure it in the Transform tab.
          • Create the DPE definition from the Transform tab. The main node and sub-type nodes are automatically populated based on the context data structure. It is recommended to retain these nodes as is.
          • Define transformation logic in the DPE definition, such as hierarchy, grouping, and formulas. This includes configuring Data Source, Data Source Subtype, Formula, Join, and Writeback nodes.
          • Create a document template and set the token mapping method to Context Service.
          • In the template, select a transformation in the Transformation Name field. Only transformations associated with the selected context definition are available.
          • Generate the document. Context Service retrieves data, DPE transforms it, and document generation uses the transformed JSON.
           
          Laddar
          Salesforce Help | Article