Question

Remove Extension DAC at Runtime

  • 14 September 2023
  • 0 replies
  • 38 views

Userlevel 3
Badge

Hi All,

This is our existing implementation that used work in 2019 version, basically the below piece of code removes an Ext Dac at runtime from the sorted list. We are planning to use the same implementation in 2022 R1 version, only change here is ActivateOnApplicationStart is obsolete in Autofac.For some reason the implementation is not working anymore, any thoughts on how this can be achieved or any better suggestions to implement the same?

namespace MyLib
{
 public class ServiceRegistration : Module 

 { 
 protected override void Load(ContainerBuilder builder)
 {

builder.ActivateOnApplicationStart<ExtensionSorting>(); // 2019 version
 

/*builder.RegisterType(typeof(ExtensionSorting)) 2022 r1
    .PreserveExistingDefaults()
    .InstancePerDependency();*/

 }
 private class ExtensionSorting
 {
     private List<Type> mySort(List<Type> list)
     {
         if (list.Contains(typeof(CRCaseExt)))
         {
             list.Remove(typeof(CRCaseExt));
         }
         list.Sort((t1, t2) => { return t1.FullName.CompareTo(t2.FullName); });
         return list;
     }

     public ExtensionSorting()
     {
         PXBuildManager.SortExtensions += (list) => mySort(list);
     }
 }
 } 
 }
}


0 replies

Be the first to reply!

Reply


About Acumatica ERP system
Acumatica Cloud ERP provides the best business management solution for transforming your company to thrive in the new digital economy. Built on a future-proof platform with open architecture for rapid integrations, scalability, and ease of use, Acumatica delivers unparalleled value to small and midmarket organizations. Connected Business. Delivered.
© 2008 — 2024  Acumatica, Inc. All rights reserved