Add a fix link
Give users a direct path to fix a failed Record Health Check. A Check can show fix instructions and a link to the page where the user makes the change, such as the record’s edit page, a related list, a report, a Knowledge article, or an external playbook.
Three fields on a Check control this:
| Field | What it does | Length |
|---|---|---|
Fix Message (FixMessage_) | Tells the user what to do next. | Long text |
Action Label (ActionLabel_) | The link text. When blank, the link reads Fix this. | 80 characters |
Action URL (ActionUrl_) | Where the link goes. The link appears only when this field has a safe value. | Long text; 2,000 characters after merge tokens are filled in |
They appear only when the Check’s result is Failed, Warning, or Info. Pass, Skipped, Unable to Check, and System Error rows never show them.
A link only navigates. Opening an edit or create page saves nothing; the user reviews the page and decides whether to save.
Decide whether a link helps
Section titled “Decide whether a link helps”A clear Fix Message is often enough. Add an Action URL only when one destination takes the user straight to the fix. Do not link to a general home page, to a page that changes data as soon as it opens, or to a page you have not tested with the access users have.
Add the fields to a Check
Section titled “Add the fields to a Check”- In Setup, open Custom Metadata Types, and select Manage Records next to Record Health Check.
- Select Edit next to the Check.
- Enter Fix Message in section 2. Explain the result to users.
- Enter Action Label and Action URL in section 4. Add a fix link (optional).
- Select Save.
Allowed Action URL formats
Section titled “Allowed Action URL formats”Record Health Check fills in merge tokens first, then checks the finished URL. A URL that is not allowed is removed, and the row shows the Fix Message without a link.
| URL | Allowed |
|---|---|
A path in the same org that starts with /, such as /lightning/r/Account/001. | Yes |
An external URL that starts with https:// | Yes |
http://, javascript:, data:, or mailto: URLs | No |
A URL that starts with // | No |
| A URL that contains a backslash, tab, or line break | No |
| A URL longer than 2,000 characters after merge tokens are filled in | No |
If a link does not appear on a failed row, check the URL against this table. A user with diagnostic access can turn on Show Diagnostics on the Check Set to see why a link was removed; other users never see a removed URL.
Use merge tokens in the label, message, and URL
Section titled “Use merge tokens in the label, message, and URL”Merge tokens insert values from the open record into the text. {!record.Name} inserts the record’s
Name, and {!record.Parent.Name fallback="no parent account"} inserts the parent Account’s Name, or
the fallback text when there is none or the user cannot read it. A record token can follow up to five
relationships.
| Field | Tokens you can use |
|---|---|
| Fix Message | Every token: record, rhcResult, rhcCheck, rhcSet, rhcRun, and rhcQuery. It can also contain inline links written as {!link label=".. |
| Action Label | Every token, but no inline links. |
| Action URL | Every token except rhcResult, because a result value is display text, not a safe part of a URL. Each inserted value is URL-encoded. |
Examples:
Action Label: Review {!record.Name fallback="this account"}Fix Message: Found {!rhcResult.foundValue}; update the record so it matches {!rhcResult.expectedValue}.Action URL: /lightning/r/Account/{!record.Id}/editWhen a token in the Action URL has no value, the link is removed unless the token has a
fallback. /lightning/r/Account/{!record.ParentId}/view shows no link on an Account without a
parent; the row still shows the Fix Message, and the Check’s result does not change. A token in
Fix Message or Action Label with no value inserts nothing, so add a fallback where empty text
would read badly.
A custom field works in a token when it exists in the org and the running user can read it. The merge syntax reference lists every token.
Link patterns
Section titled “Link patterns”Replace each placeholder, such as 00Oxxxxxxxxxxxxxxx or Data_Quality_Playbook, with a value from
your org.
| Destination | Action URL |
|---|---|
| View the current Account | /lightning/r/Account/{!record. |
| Edit the current Account | /lightning/r/Account/{!record. |
| The Account’s Contacts related list | /lightning/r/Account/{!record. |
| A report filtered to the current record | /lightning/r/Report/00Oxxxxxxxxxxxxxxx/view?fv0={!record. |
| A Contact list view | /lightning/o/Contact/list?filterName=Recent |
| A Knowledge article | /lightning/r/Knowledge_ |
| A Lightning app page | /lightning/n/Data_ |
| An external playbook | https://support. |
Create a related record with prefilled values
Section titled “Create a related record with prefilled values”A Lightning create URL can prefill fields with defaultFieldValues:
/lightning/o/Case/new?defaultFieldValues=AccountId={!record.Id},Subject=Review%20{!record.Name fallback="this record"},Origin=WebThe user still reviews and saves the new Case. Salesforce can require other fields, or reject a default value that is not valid for the user, so test the link as a user who will use it.
To create a Task related to the record, prefill Related To with WhatId:
/lightning/o/Task/new?defaultFieldValues=WhatId={!record.Id}WhatId relates the Task to an Account, Opportunity, Case, or similar record. To relate it to a
Contact or Lead, prefill Name with WhoId instead.
Some installed example Checks use /lightning/r/Task/new instead. Salesforce’s create pattern is
/lightning/o/<object>/new, so use that form in your own Checks, and test any link you copy from
an example.
Filter a report
Section titled “Filter a report”Lightning report URLs pass filter values in order: fv0 sets the report’s first filter, fv1 the
second, and so on.
/lightning/r/Report/00Oxxxxxxxxxxxxxxx/view?fv0={!record.Id}&fv1={!record.Parent.Name fallback="no parent account"}This URL works when the report’s first filter expects the record ID and its second filter expects the
parent Account’s Name. A report ID is different in every org. To find it, open the report and copy
the 00O... value from the browser address.
To find a Knowledge article ID, open the published article and copy the ka0... value from the
browser address. Article visibility can differ by language, channel, and user.
Examples
Section titled “Examples”Contacts are missing email addresses
Section titled “Contacts are missing email addresses”| Field | Value |
|---|---|
| Action Label | View contacts to fix |
| Action URL | /lightning/r/Account/{!record. |
| Fix Message | Open the contacts for {!record. |
High-priority Cases are open
Section titled “High-priority Cases are open”| Field | Value |
|---|---|
| Action Label | View high-priority cases |
| Action URL | /lightning/r/Report/00Oxxxxxxxxxxxxxxx/view?fv0={!record. |
| Fix Message | Review the open high-priority cases for {!record. |
A playbook outside Salesforce
Section titled “A playbook outside Salesforce”| Field | Value |
|---|---|
| Action Label | Open data quality playbook |
| Action URL | https://example. |
| Fix Message | Review the playbook before changing ownership or tier fields for {!record. |
Test the link
Section titled “Test the link”- Fail the Check on a test record and confirm that the link appears with the expected label.
- Open the link as a user with normal access and confirm the destination.
- Confirm that opening the link changes no data.
- Confirm that a report link uses a report ID from the same org.
- Clear a field used in a merge token and confirm the fallback text reads well.
- Confirm the Fix Message still makes sense if the link is removed.