cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
TanguyT
MVP

Bug in context.mode.contextInfo property for subgrid : entityTypeName gives incorrect value

When using context.mode.contextInfo, property entityId gives the id of the parent form record, which is what is expected. But property entityTypeName gives the name of the subgrid entity and not the parent form entity.

 

Two questions:

  • when contextInfo will come as a predefined and supported property of property "mode"?
  • when a fix can be expected for this bug?

Thanks

1 ACCEPTED SOLUTION

Accepted Solutions

Hi TanguyT, 

 

Currently, this API is not documented and not supported.   We understand the need for controls to get this type of context information and will be exposing it through supported APIs soon.   

 

Todd

View solution in original post

10 REPLIES 10
ben-thompson
Solution Sage
Solution Sage

How are you accessing context.mode.contextInfo?

 

contextInfo is not a published accessible attribute of context.mode within the PCF framework.

---
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".

I know but this is the only way included (even if not documented, this is why I asked) that should let you know the context of the entity record the PCF component is rendered

Hi TanguyT, 

 

Currently, this API is not documented and not supported.   We understand the need for controls to get this type of context information and will be exposing it through supported APIs soon.   

 

Todd

View solution in original post

Great! Please don’t forget to fix the bug where EntityTypeName shows the wrong value

So that explains why my idea request for access to context.mode.contextInfo disappeared so quickly...

 

I'm glad to hear it's arriving soon as that saves me writing the workaround I thought I would have to create to do things in a "supported" way...

---
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".
EricRegnier
Super User
Super User

Hi @TanguyT, I have a similar scenario where I need the parent ID and entity name in a subgrid control. Have you found a workaround? Look at the querystring parameters? Cheers

Hi  @EricRegnier , 

 

You can use context.mode.contextInfo.entityTypeName and context.mode.contextInfo.entityId.

They are both unsupported for now, but they are working just fine.

 

Kind regards,

Diana

Kind regards,
Diana
----------
Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."

Thanks for confirming @DianaBirkelbach, but I can't access context.mode.contextInfo in the typings... I guess we need add the 

@ts-ignore tag?

You are correct 

Helpful resources

Announcements
PA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

secondImage

Power Apps Community Call

Please join us on Wednesday, October 20th, at 8a PDT. Come and learn from our amazing speakers!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Welcome Super Users.jpg

Super User Season 2

Congratulations, the new Super User Season 2 for 2021 has started!

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

Users online (2,521)