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:
Thanks
Hi @EricRegnier ,
@ts-ignore is a possibility. The alternative is casting:
(context.mode as any).contextInfo.entityId
Kind regards,
Diana
You are correct
Thanks for confirming @DianaBirkelbach, but I can't access context.mode.contextInfo in the typings... I guess we need add the
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
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
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...
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
How are you accessing context.mode.contextInfo?
contextInfo is not a published accessible attribute of context.mode within the PCF framework.
WarrenBelz
87
Most Valuable Professional
mmbr1606
71
Super User 2025 Season 1
Michael E. Gernaey
65
Super User 2025 Season 1