Skip to main content

Notifications

Announcements

No record found.

Finance | Project Operations, Human Resources, ...
Answered

how to override lookup with respect to enum value element.

Posted on by 51
I have this requirement:
 
Firstly i have to extend base enum and add element named  / Transfer order/
Now i have to add lookup on the existing lookup for the transfer orders now because for every enum type the lookup is different now i want lookup for transfer order.
I have created lookup for transfer order but it is appearing on every enum type i wanted my lookup only for transfer order that i added on base enum.
 
This is the code that i write for override lookup:
 
 
 
 
By this code lookup is appearing on every enum
  • Verified answer
    Martin Dráb Profile Picture
    Martin Dráb 230,235 Most Valuable Professional on at
    how to override lookup with respect to enum value element.
    Well, you're completely missing a condition saying that you want your custom logic only for transfer orders. But don't bother adding it, because the whole approach is wrong.
     
    The standard logic already supports the scenario. It uses the plugin framework to create a specific class implementing CaseIAssociation intrerface and calling its performLookup() method. You just need to implement such a class for transfer orders.
     
    For example, look at CustTransCaseAssociationProvider. Don't miss ExportMetadataAttribute - that's what tells the class factory which class should be used for a particular value CaseEntityType enum.

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,235 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Product updates

Dynamics 365 release plans