pnp / pnp/sp-dev-fx-controls-react
BUG: DynamicForm does not properly load lookup field when the webpart is not in the same site as the lists.
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 433
- Forks
- 418
- Avg merge
- 5d 6m
- Merged PRs (30d)
- 19
Description
When using DynamicForm component I set the webAbsoluteUrl to refer to the site where the list is located. If the list includes a lookup field and the webpart is running in a different site that webAbsoluteUrl, the lookup field fails to load lookup options and displays the error "Cannot read properties of undefined (reading 'TypeAsString')"
I assume that I need to pass a different context to the component. Any guidance on how best to do that? I do have an spfi object that corresponds to the webAbsolutUrl site.
<DynamicForm
webAbsoluteUrl={this.state.matterSiteUrl}
listId={this.state.matterListId}
onCancelled={() => { this.setState({ showNewMatter: false }) }}
onBeforeSubmit={this._matterOnBeforeSubmit}
onSubmitError={(listItem, error) => { console.log(error.message); }}
onSubmitted={async (listItemData) => {
await this._readMatterListItems();
await this._getSelectedMatter(this.state.matterlist);
}}
context={this.props.context}
/>
Category
[ ] Enhancement
[X] Bug
[ ] Question
Version
Please specify what version of the library you are using: [ 3.20.0 ]
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start at the DynamicForm component and trace how webAbsoluteUrl, context, and lookup fields are used when loading a list from another site. Reproduce the issue with the supplied props and version 3.20.0; done means lookup options load without the TypeAsString error for a cross-site list.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- react, typescript
- Domain
- frontend
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100