cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Helper I
Helper I

Form Context in PCF

I am trying to get the form context of a form in my PCF component. Since Xrm.Page is deprecated, how can we get the form context in PCF Component?

9 REPLIES 9
Highlighted
Resolver I
Resolver I

In PCF we use context which is passed as parameter in init and updateView function. You can get pretty much all the things that are in Xrm. You can check the ComponentFramework declaration file or PCF Docs website for more info

Highlighted
MVP
Highlighted

How will I get the formContext using context parameter in PCF? Is there any function to get the formContext?

@sheldoncopper73 

Highlighted

How do i get the form context from the context parameter in init function? Is there a method that provides this?

@sheldoncopper73 

Highlighted

How will I get the form context from context parameter passed in init function? Is there a function to do it?

@sheldoncopper73 `

Highlighted

How will I get the form context from context parameter passed in init function? Is there a function to do it?

@sheldoncopper73 `

Highlighted

In the init function you have this: context: ComponentFramework.Context<IInputs>

So you can use it like this : 
context.png
Highlighted

Given that no-one seems to have answered your question I will step in and answer it.

 

By design PCF components are designed to be self contained and do not have access to the Form context.

---
If this post has answered your question please consider it for "Accept as Solution" or if it has been helpful give it a "Thumbs Up".
Highlighted

Be careful, it depends on what you want to do.

 

Indeed, the component has its own context but is sent to it from the application so if you want to access particular fields for example, you just have to add them as property of your PCF and you would have access to them.

 

 

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

News & Announcements

Community Blog

Stay up tp date on the latest blogs and activities in the community News & Announcements.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Community Highlights

Community Highlights

Check out the Power Platform Community Highlights

Users online (8,256)