Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics CRM forum
Unanswered

is there a way to .FireOnChange() after Order form [Look up Addresses] dialog?

Posted on by Microsoft Employee

I need to have a javascript method fire onChange of sendto_name and/or sendto_stateorprovince and/or sendto_postalcode.

Normally I would add a fireOnChange() to the onChange of the triggering field.  However, I don't know how to append the method to the process behind the [Look up Addresses] button.  And if I just have it on the 3 fields the user has to save before the method fires then save a second time for the method's results.

Aside from ribbon modification, is there any way to solve this?

TIA

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: is there a way to .FireOnChange() after Order form [Look up Addresses] dialog?

    Perhaps the aspect you are missing that I didn't lay out was that the event is a change of address RECORD not a change of customer.  A given account has address1, address2 and N number of ship-to addresses.  When the ship-to address is set {address3 through N}, I need to to respond to the two fields mentioned.

    To review using your example, if it were a change of customer, I can put the method on the one of the fields AND put that-field.FireOnChange() on the customer field.  I can't do that because there is no "onChange event" for the [Look up Addresses] button.

    Regarding your button suggestion: if you mean by API the method associated with the button command, yes.  I could pull that into some javascript, add the FireOnChange then make that javascript the new button command.  I'm trying to avoid that with something that is more "first level" customization than fussing with the ribbon -- if possible.

    It's just academic now since I bit the bullet and solved it with a pre-validation plugin, anyway.

  • RE: is there a way to .FireOnChange() after Order form [Look up Addresses] dialog?

    Hello,

    sorry I didn't understand what you want to do.

    Normally the "Look Up Address" button is opening a modal dialog showing you the addresses of the Potential Customer you selected on the Order.

    So after you select the Potential Customer and select the address related with him using the "Look Up Address", in the Order is auto-populated the section about Addresses.

    If you change the Potential Customer, to change as well the section in the Order, you have to use the "Look Up Address" to retrieve the addresses related with that Potential Customer.

    You cannot edit that modal dialog; what you can do is something custom ( button and web resource ) that is doing an api call to retrieve the address for that specific customer.

    After that you can manage the events on that custom web resource ( html page ) and access on the fields on the order  using parent.Xrm.Page.

    Thanks,

    Regards

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

Anton Venter – Community Spotlight

Kudos to our October Community Star of the month!

Announcing Our 2024 Season 2 Super Users!

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

Dynamics 365 Community Newsletter - September 2024

Check out the latest community news

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 290,532 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 228,501 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,148

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans