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

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

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

JScript for Mapping Lookup fileds

(0) ShareShare
ReportReport
Posted on by 422

Hi All,

I'm looking for help from all of the developers here.

I have two custom entities Examination (sc_examination) and Prescriptions (cs_prescription)

The examination has a lookup filed called sc_patient and sc_spceialist which contains the patient record and the doctor's record.

pastedimage1611314434349v1.png

pastedimage1611314656133v3.png

from the Examination entity, you can create a new prescription record.

However, when I create a new prescription record, doesn't auto-populate the patient and the doctor's lookup fields, so I have to add them manually every time even though I'm using a subgrid inside the examination entity.

pastedimage1611314767447v4.png

I'm looking for a Jscript that I can use on the Prescription form on Load to get the Patient and the Doctor and populat them into the prescription so I can save some time looking for the patient and the doctor.

Any help is appreciated.

  • Verified answer
    chrispytwist Profile Picture
    235 on at

    Hey Kiril,

    have you mapped these fields in the 1:N relationship manager? No JS needed for this (which also means less maintenance if APIs change)

    This might help: readyxrm.blog/.../

  • Radoslavov Profile Picture
    422 on at

    Hi,

    Yes, I tried, but you cannot map one file to multiple fields.

    The connection here is Examination - Prescription (taking the patient value from the examination and filled to the prescription)

    So there is no 1:N connection between the patience filed in the prescription and the patienceid.

    This is why i need a custom solution.

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Women in Power Builds Momentum

Expanding mentorship, skilling, and AI innovation

Congratulations to the August Top 10 Community Leaders

These are the community rock stars!

Leaderboard > Customer experience | Sales, Customer Insights, CRM

#1
Daniyal Khaleel Profile Picture

Daniyal Khaleel 87 Most Valuable Professional

#2
11manish Profile Picture

11manish 67 Super User 2026 Season 2

#3
Travis South Profile Picture

Travis South 35

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans