Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Customer experience | Sales, Customer Insights,...
Unanswered

xrm.navigation.openform set lookup field automatically from the previous form

(0) ShareShare
ReportReport
Posted on by 45
  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: xrm.navigation.openform set lookup field automatically from the previous form

    Hi Omar Bouattour,

    As Pradeep Rai said, you can get FormContext first and then use getEntityReference() to get lookup value of Parcours.(API: https://docs.microsoft.com/en-us/powerapps/developer/model-driven-apps/clientapi/reference/formcontext-data-entity/getentityreference).

    Here is a thread which is same as the things you are doing(If I don't misunderstand), you can refer to it:

    community.dynamics.com/.../how-to-pass-javascript-entity-1-record-data-via-extraq-parameters-to-entity-2-via-javascript-by-means-of-add-new-record-subgrid 

  • Pradeep Rai Profile Picture
    Pradeep Rai 5,482 Super User 2025 Season 1 on at
    RE: xrm.navigation.openform set lookup field automatically from the previous form

    Add on to above

    One question i have, As per the above screenshots 1 Parcours can have multiple Questions.

    Which mean we have 1:N relationship between them.

    So, why you are creating new ribbon to open the Question records. You can use Related Tab or You can add subgrid of Questions entity on "Parcours".

    With OOB way you can use Quick Create and Main form to fill the details. here, you can use the Relation Mapping concept to prepopulate the field values.

    Thanks,

    Pradeep.

  • Pradeep Rai Profile Picture
    Pradeep Rai 5,482 Super User 2025 Season 1 on at
    RE: xrm.navigation.openform set lookup field automatically from the previous form

    Hi,

    If i understand it correctly then on "Parcours" entity form, you have added Ribbon Button to open the "Question" entity records.
    Now, on "Question" entity you have a lookup field of "Parcours" entity. and you want the "Parcours" entity Id.

    To achieve this please follow below steps:

    1. On Ribbon button add one Parameters as shown in below screenshot:
    d365demystified.com/.../

    2. In your JS file you can use below code get the "Parcours" record Id:
    formContext.data.entity.getId();

    FormContext you will get from first step.

    Now, you have the "Parcours" entity id with you and you can add this in your above code.

    Thanks,
    Pradeep.

    Please mark this as VERIFIED. if it helps.

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

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Vahid Ghafarpour – Community Spotlight

We are excited to recognize Vahid Ghafarpour as our February 2025 Community…

Tip: Become a User Group leader!

Join the ranks of valued community UG leaders

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 292,494 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 231,305 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans