web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Navigate to Model Driv...
Power Apps
Answered

Navigate to Model Driven App record using Fluent UI 'Link Component on PCF

(0) ShareShare
ReportReport
Posted on by 17

Afternoon, 

 

I'm hoping someone can point me in the right direction.

I have a PCF in a Model Driven app that displays fields from an unrelated record. The fields display correctly but i'm trying to recreate the experience of a lookup field. So far I have been able render the below using the 'Link' component in the Fluent UI, which looks correct but the link itself currently doesn't lead anywhere :).

 

Capture.PNG

 

Below is the snipping of the typescript being used to display this. 

 

Capture2.PNG

 

I'd like to get this URL to lead directly to the record that is selected in the lookup. In the index.ts I am getting the EntityName, Name & ID that can be used. I'd like to make it dynamic to the environment its present in so i'm not hardcoding the org and app id.

 

I'm thinking I could call 'Xrm.Navigation.openForm' using these values in the '<Link' but have been unable to add anything but a string value.

 

Any help or pointers would be much appreciated.

 

Thanks!!!

I have the same question (0)
  • OOlashyn Profile Picture
    3,498 Most Valuable Professional on at

    Hi @TomPhillips ,

     

    You need to call context.navigation.openForm to open a form for the specified record in PCF. You can find documentation here.

  • Verified answer
    v-xida-msft Profile Picture
    Microsoft Employee on at

    Hi @TomPhillips ,

    Do you want to open a selected record from the LookUp directly when you press the Link control?

     

    If you want to open a  selected record from the LookUp directly, I agree with @OOlashyn 's thought almost. I think the

    context.navigation.openForm(options, parameters)

    method could achieve your needs.

     

    Based on the needs that you mentioned, I think the URL inside your <Link> control could not achieve your needs. Please take a try with the following workaround:

    1. Define a function in your TypeScript code:

    private _onColumnClickView(event) {
     context.navigation.openForm(
     {
     entityName: "xxx",
     entityId: "xxx guid value xxxx",
     openInNewWindow: false,
     windowPosition: 1
     }
     )
    }

    Note: Replace the 'xxxx' with actual value required for the attributes within the context.navigation.openForm() function.

     

    2. Add a onClick event to your <Link> control, modify your Link control as below:

    <Link onClick={this._onColumnClickView.bind(this)}>
     {this.grabValueFromFieldDefinition(this.state.fieldDefinition)}
    </Link>

    Please consider take a try with above solution, then check if the issue is solved.

     

    More details about launching a form using Client API in PCF project, please check the following article:

    https://docs.microsoft.com/en-us/powerapps/developer/component-framework/reference/navigation/openform

     

    Best regards,

  • TomPhillips Profile Picture
    17 on at

    @v-xida-msft Thank you very much, that is excellent information and worked correctly!

  • ShishirG Profile Picture
    7 on at

    @TomPhillips , I am new to PCF, and I want to create the same PCF that you created, so could you please provide me the solution file and the PCF code?

    It will really helpful for me.

    Thanks in advance

     

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
Vish WR Profile Picture

Vish WR 914

#2
11manish Profile Picture

11manish 627

#3
Valantis Profile Picture

Valantis 598

Last 30 days Overall leaderboard