> For the complete documentation index, see [llms.txt](https://docs.avonnicomponents.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.avonnicomponents.com/projects/use-cases/inside-a-flow/case-triage-assignment.md).

# Build a Case Assignment Screen Flow in Salesforce

Review and assign cases with Avonni Data Table and Record Detail, and handle a refused update with an Alert in Salesforce Screen Flow.

<figure><img src="https://3857391697-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FdHOej9Pd5IxJNGEJMZKW%2Fuploads%2FiyTHJt3AF0XJoF7fY8jh%2Fcase-triage-flow-cover.jpg?alt=media" alt="Case Triage in Salesforce Lightning showing Billing question and Locked return in Avonni Data Table."><figcaption></figcaption></figure>

## Build the project

Choose how you want to build:

✨ **Build with AI** — Give your AI assistant a ready-to-use prompt.

🛠️ **Build it** — Follow the steps yourself.

{% tabs %}
{% tab title="Build with AI" icon="wand-magic-sparkles" %}
{% stepper %}
{% step %}

#### Prepare the assistant and sandbox

Follow [Build with AI](https://docs.avonnicomponents.com/build-with-ai) and use the avonni-flow-components skill.
{% endstep %}

{% step %}

#### Copy the prompt

{% code title="Case triage build prompt" collapsedlinecount="10" %}

```
Build a Salesforce Screen Flow for case assignment. Use Avonni Data Table for a single required selection, read-only Record Detail to preview the selected case, and Alert for a refused update. Verify names and outputs with the Avonni MCP. Show the sandbox and field mapping before writes.
Use the Support Triage queue, two sample cases and exact validation rule from the manual path. In user context, get the running user's demo cases, change only the selected owner, and route Update Records faults to the error screen. Both outcomes must return to a fresh query.
Activate in the sandbox. Test both cases in Lightning and check the saved OwnerId after each attempt.
```

{% endcode %}
{% endstep %}

{% step %}

#### Review and test

Use the Try it steps below to verify the queue and the selected record in Salesforce.
{% endstep %}
{% endstepper %}
{% endtab %}

{% tab title="Build it" icon="screwdriver-wrench" %}
{% stepper %}
{% step %}

#### Prepare the queue and sample cases

Install Avonni Flow Screen Components in a sandbox. Use a test user who can run the flow, read the cases and change their owner. In Setup → Queues, create Support Triage with API name Avonni\_Project\_Triage\_Team and add Case as a supported object.

Create two New cases owned by your test user with Origin set to Web. Use the exact subjects below, with Medium priority for Billing question and High for Locked return.

{% code title="Sample case subjects" collapsedlinecount="10" %}

```
Avonni Project Triage - Billing question
Avonni Project Triage - Locked return
```

{% endcode %}

On Case, create a validation rule with the formula below and set the error message to “This demo case is locked for review. Its owner cannot be changed.”

{% code title="Case validation rule" collapsedlinecount="10" %}

```
AND(ISCHANGED(OwnerId), Subject = "Avonni Project Triage - Locked return")
```

{% endcode %}
{% endstep %}

{% step %}

#### Show and review one case

Create a Screen Flow in user context. Get all Cases where OwnerId is the running user and Subject starts with Avonni Project Triage - . Sort by Case Number. Add a Data Table from that record collection and display Case Number, Subject, Priority and Status. Set Id as the row key and make one selection required.

On the next screen, add read-only Record Detail for Case. Set Record ID to the Data Table’s first selected row key. Label Next Assign to Support Triage.
{% endstep %}

{% step %}

#### Update the owner and handle the fault

Get the Group where Type is Queue and DeveloperName is Avonni\_Project\_Triage\_Team. Update the Case whose Id matches the selected row. Set OwnerId to the Group Id.

Connect success to a Case assigned screen. Connect the Update Records fault to an error Alert with Assignment refused and show the Salesforce fault for this sandbox exercise. Give both screens a Back to cases button that runs Get Cases again. Activate the flow and open it in Lightning.
{% endstep %}
{% endstepper %}
{% endtab %}
{% endtabs %}

## Try it

1. Select Locked return and verify the correct case details before assigning.
2. Click Assign to Support Triage. Check the Salesforce refusal. Choose Back to cases and confirm the case is still listed.
3. Assign Billing question and choose Back to cases. Billing question should disappear and Locked return should remain. Check both saved owners.

**Sandbox result.** In Lightning as a sandbox administrator, Salesforce refused Locked return with the configured validation message and its owner stayed the same. Billing question moved to Support Triage and left the table after Back to cases, without reloading the browser.

## Component references

* [Data Table](https://docs.avonnicomponents.com/flow/flow-components/data-table)
* [Record Detail](https://docs.avonnicomponents.com/flow/flow-components/record-detail)
* [Alert](https://docs.avonnicomponents.com/flow/flow-components/alert)


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.avonnicomponents.com/projects/use-cases/inside-a-flow/case-triage-assignment.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
