Skip to content

Commit

Permalink
fix: prettier
Browse files Browse the repository at this point in the history
  • Loading branch information
pozil committed Jan 12, 2024
1 parent e5bbe0a commit da91cc5
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ The lookup can return default search results with the `setDefaultResults(results

Here's how you can retrieve recent records and set them as default search results:

1. Implement an Apex endpoint that returns the recent records:
1. Implement an Apex endpoint that returns the recent records:

```apex
@AuraEnabled(cacheable=true scope='global')
Expand All @@ -175,13 +175,13 @@ Here's how you can retrieve recent records and set them as default search result

See the [full code from the sample app](/src-sample/main/default/classes/SampleLookupController.cls#L59)

1. In your parent component, create a property that holds the default results:
1. In your parent component, create a property that holds the default results:

```js
recentlyViewed = [];
```

1. Write a utility function that sets your default search results:
1. Write a utility function that sets your default search results:

```js
initLookupDefaultResults() {
Expand All @@ -193,7 +193,7 @@ Here's how you can retrieve recent records and set them as default search result
}
```

1. Retrieve the recent records by calling your endpoint:
1. Retrieve the recent records by calling your endpoint:

```js
@wire(getRecentlyViewed)
Expand All @@ -205,15 +205,15 @@ Here's how you can retrieve recent records and set them as default search result
}
```

1. Initialize the lookup default results when the parent component loads:
1. Initialize the lookup default results when the parent component loads:

```js
connectedCallback() {
this.initLookupDefaultResults();
}
```
> [!NOTE]
> `initLookupDefaultResults()` is called in two places because the wire could load before the lookup is rendered.
```js
connectedCallback() {
this.initLookupDefaultResults();
}
```

> [!NOTE] > `initLookupDefaultResults()` is called in two places because the wire could load before the lookup is rendered.

### Saving form state when creating new records (optional)

Expand Down

0 comments on commit da91cc5

Please sign in to comment.