Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics CRM (Archived)

Lookup display name change doesn't trigger plugin

Posted on by 155

I have a 1:N relationship between Account to custom entity Product.

I'm generating the product name based on the Account display name + couple other fields using a Plugin. But issue is when the Account name is changed (Account level), the lookup display name is changing (on Product Entity) but the plugin is not triggering to generate the new name.

 Please suggest a solution.

Thanks!!

*This post is locked for comments

  • Suggested answer
    Pawar Pravin  Profile Picture
    Pawar Pravin 5,227 on at
    RE: Lookup display name change doesn't trigger plugin

    Hi Ram,

    I believe you are triggering your plugin on product entity. In case if you want to update product name on change of Account name then create one more plugin on update of account name and update product name accordingly

  • Suggested answer
    Charles Abi Khirs Profile Picture
    Charles Abi Khirs 3,569 on at
    RE: Lookup display name change doesn't trigger plugin

    Hello,

    you have to create a plugin on the account update, where you get the related products using CRMService.RetrieveMultiple(query) method and applying  for each on every single product record retrieved in order to update its name accordingly.

    As for the Account lookup change on the product record level, you can use a real-time workflow to update the product name.

  • Suggested answer
    Dynamics365 Rocker Profile Picture
    Dynamics365 Rocker 7,755 on at
    RE: Lookup display name change doesn't trigger plugin

    Your plugin registered on "Product" entity and you are making change in "Account" entity. If you want a plug-in get trigger on account name change then register it on Account entity.

  • Suggested answer
    RaviKashyap Profile Picture
    RaviKashyap 55,410 on at
    RE: Lookup display name change doesn't trigger plugin

    Hi,

    As you have registered the plugin pn change of Account lookup on Product entity, it will trigger only when the value of the account lookup changes. In your case, you are changing the name field on the same account record which is getting changed in the lookup value as ell but the actual account value is not changed.

    For example, you added "Account One" to Product. Now you changed the name of "Account One" to "Account Two" this is a a change in Account entity. Now in the lookup fiel the name field gets displayed of the selected account. Because the name field of the account was "Account One" before, it displays that and after changing it is displaying the updated value. There is no change in the field of the product entity which is why the plugin is not triggering.

    This is one a the most common requirement where you want to update the child records when parent field changes. You can create a plugin on account name change as well and then within the plugin retrieve all the product and set the name.

    Hope this helps.

  • Itz_Me_Ram Profile Picture
    Itz_Me_Ram 155 on at
    RE: Lookup display name change doesn't trigger plugin

    Post-operation and have that lookup in filtering attribute.

  • Abhishek Gupta Profile Picture
    Abhishek Gupta 2,001 on at
    RE: Lookup display name change doesn't trigger plugin

    HI,

    At which event you are triggering your plugin and what are your filtering attributes?

    Thanks

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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,280 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,214 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans
Liquid error: parsing "/globalsearch/?q=lookinga+toten%E2%80%99nof+view+and+aousing++nager+want+for+something+is+not+to+be+construed+as+mn" - Nested quantifier +.