Loading
Salesforce Document Generation
Indhold
Vælg filtre

          Ingen resultater
          Ingen resultater
          Her er nogle søgetips

          Kontroller stavemåden for dine søgeord.
          Brug mere generelle søgeudtryk.
          Vælg færre filtre for at gøre søgningen bredere.

          Søg efter alle i Hjælp til Salesforce
          Context Filters for Document Generation

          Context Filters for Document Generation

          Document generation often pulls data from complex models that return more records than a document requires. To exclude irrelevant data, use filters to control which data the context service fetches before generating a document. When you add a filter to a template, document generation applies the filter every time a document is rendered.

          Required Editions

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

          You define context filters in a context definition. Each filter belongs to a single context definition and becomes available automatically when you use that context definition in a document template. Filters are optional. If you don’t select a filter, document generation uses all records returned by the context definition and mapping.

          What Context Filters Do

          A context filter can refine data in three ways:

          • Filter records by using defined conditions
          • Sort records by a single attribute
          • Limit records returned after sorting

          Context filters operate on context nodes and attributes, not directly on Salesforce object fields. These nodes and attributes come from the canonical structure defined in the context definition. All filter conditions use AND logic. The UI doesn’t support OR conditions and complex expressions that combine multiple condition types.

          How Context Filters Work with Document Generation

          When you generate a document by using context service, it evaluates the context definition and token mapping. It then applies the selected filter and passes the filtered token data to document generation to populate the template.

          If you configure a transform plug-in, document generation passes the filtered token data to the transform logic. Filters always apply before transformation. See Transform Token Data with Context Service for Document Generation.

          Note
          Note If a filter references an unmapped attribute, document generation fails at run time.

          You can create context filters to refine line items included in a document. For example, you can:

          • Filter quote line items based on quantity or price thresholds.
          • Sort filtered items in descending or ascending order.
          • Limit the output to the most relevant records for the document.

          When you generate the document, only the filtered and sorted line items appear. The template layout doesn’t change. Only the data passed into the template changes.

          Scope and Support

          • You can select only one context filter per document template.
          • Filters apply only to future document generations.
          • Filters don’t modify Salesforce data.
          • Document generation supports context filters only when the context service is the token mapping method.
          • Document generation in the Omnistudio managed package doesn’t support context service or context filters.
           
          Indlæser
          Salesforce Help | Article