Forum Discussion

IndyDetour's avatar
IndyDetour
Copper Contributor
Mar 23, 2024

How to get a reference to "context" in onBeforeSubmit

I have an SPFX project that is a form extension using the React framework. I am debugging the edit form. I do some validation in the onBeforeSubmit method and I do not seem to be able to get a reference to the context using this.context. 

I pass the context into the <DynamicForm element using props. The form loads the listitem correctly and saves changes correctly, but I still can't reference these items within onBeforeSubmit. 

I think I'm just missing something within SP or React and thought I'd post here to see if someone had an idea as to what it may be.

Thanks

 

No RepliesBe the first to reply

Resources