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 :
Dynamics 365 Community / Forums / Finance forum / Multiple extensions to...
Finance forum

Multiple extensions to same object

(1) ShareShare
ReportReport
Posted on by 15

We have an situation where we have multiple developers working on the same project and will have some customization, probably in the future we will have some extensions to the same objects. So the question is how to work with extensions to already existing extension?

Is the best way to always create a new extension for each new functionality or is it best practice to one create an extension the first time and then use the same? Our concern is that we have too many extensions to the same object in the future.

  • Verified answer
    Sukrut Parab Profile Picture
    71,741 Moderator on at

    Creating multiple extension in your own model for same object is not going to cause any harm and there is no best practice associated  with it . You have to just make sure when new extension is created you name it properly e.g CustTable.MyExtension instead if keeping default name like custTable.extension1. This would help to avoid conflicts if  Microsoft creates extension for same object. If you want to Keep number of extensions minimum to keep it simple then your devs can search for already existing  extension and add functionality to the same one.

  • Verified answer
    nmaenpaa Profile Picture
    101,172 Moderator on at

    The best way really depends on your scenario. Simple is beautiful, so I would ask is there a benefit to split the extensions of one standard object to multiple classes or table/form extensions (in one model / package)? If there is value for you, you can consider it.

    Since the execution order of event handlers / CoC is random, you should place dependent extensions in same method.

    Searching and examining existing code is easier if you don't have 20 extension classes for one standard object.

    Also you can't extend extensions.

  • Dansne Profile Picture
    15 on at

    Thank you both for great input. This cleared my concerns and will most probably go for one extensions only for most cases.

  • yasserSaber Profile Picture
    40 on at

    Hello ,

    Can i do two extensions for standard form and let two different menu items each one to refer one of the extensions ?  Because i need to use the same form but with update some logic that it prepared for specific group of users and another update some logic for another group of users so i cannot let the two user groups working in same logic but both based on the same form needed 

  • Suggested answer
    ergun sahin Profile Picture
    8,826 Moderator on at

    Yes you can, but if you have two button then you can create a extension with two method too

  • yasserSaber Profile Picture
    40 on at

    Thank you for your answer , how i can assign form with specific extension only to the menu item instead of the form with all extensions of it

  • André Arnaud de Calavon Profile Picture
    307,801 Super User 2026 Season 2 on at

    Hi Yasser,

    Using x++ logic, you can determine which menu item was used to open the form. Then you can use this information to show or hide form controls. This would require x++ coding.

  • yasserSaber Profile Picture
    40 on at

    Thank you Arnaud ,

    The problem that the changes are big so its not simple to handle in if and else .If any solution  even x++ to enable the whole extension for specific menu item and  another whole extension for another menu item

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

November Spotlight Star - Khushbu Rajvi

Congratulations to a top community star!

Forum Structure Changes Coming on 11/8!

In our never-ending quest to help the Dynamics 365 Community members get answers faster …

Dynamics 365 Community Platform update – Oct 28

Welcome to the next edition of the Community Platform Update. This is a status …

Leaderboard > Finance

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans