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,...
Suggested Answer

OnChange event no firing after updated lookup item

(0) ShareShare
ReportReport
Posted on by 5

Im using javascript to monitor the onChange of a Lookup field and then set some fields with the relevant data eg the rate of an selected product.This works without issue except if I edit the selected items details. In that case the onChange is not fired.

When i click on the selected items hyperlink, it opens the record in an edit form and I can update the fields. Lets say I changed the rate and the product name.

I then save that form and it returns to the calling form, showing the new name in the lookup. However the onChange function doesnt run and the rate remains as the old value.

I have to remove the selected item and then select it again for it to update the rate with the new value.

Is there any event to hook into so that I can update the form fields with their new values? Im extremely new to this and new to javascript...

Here is the hyperlink im talking about, which opens the form to edit that item.  

pastedimage1651466777240v1.png

I have the same question (0)
  • Suggested answer
    Amit Katariya007 Profile Picture
    10,409 Moderator on at

    Hello,

    On change event will be fire on the same form/ current form. That means if you have on change event on "Form A" which have this lookup field(Existing Item), If you change the value in the lookup then JS will be called else it will not.

    In your scenario you are changing the content of "Widget2" but the GUID of this record will remain same. And this GUID is still associated with the "Form A" record.

    So in-short system will look into GUID in case of Lookups rather than the field properties of lookup record(Because selected value in the lookup is related record, it's fields are not associated with the main record).

    If you want to trigger the Main record when there is any change in the lookup record fields then you need JS where you are fetching the related records and update it. You can also use the Plugin.

    Thank you,

    Amit Katariya  

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 Stars!

Meet the Microsoft Dynamics 365 Contact Center Champions

We are thrilled to have these Champions in our Community!

Congratulations to the March Top 10 Community Leaders

These are the community rock stars!

Leaderboard > Customer experience | Sales, Customer Insights, CRM

#1
ManoVerse Profile Picture

ManoVerse 196 Super User 2026 Season 1

#2
11manish Profile Picture

11manish 129

#3
CU11031447-0 Profile Picture

CU11031447-0 100

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans