Solved

Extend same graph in multiple customisations


Hi,

Nice to meet you all. Long time reader first time poster.

In 2022R1, I am trying to publish a customisation that includes an extension to the SOOrderEntry graph. I am having problems though because an existing customisation that also includes an extension to the same graph is already published. The first time I tried this, the whole application crashed because my extension was the only one published, and the other customisation had other code that tried to obtain a reference to its extension using CreateInstance<SOOrderEntry>.GetExtension<”extension name”>().

I tried to replicate this error in a local instance also running 2022R1, but it didn’t happen, and browsing my filesystem provides a clue as to why. In the <Appfolder>\App_Code\Caches folder, my extension is contained in a file named ‘SOOrderEntry.cs’. The other extension is contained in a file named ‘<Package name>.SOOrderEntry.cs’, where <Package name> is the name of the .NET package it exists in. This seems to allow both extensions to coexist, and through testing, I have determined that the code for both extensions is being run.

This implies that there is some system setting that governs whether extensions can coexist like this. Does anybody know of such a setting?

 

Thanks in advance,

Ben.

icon

Best answer by Zoltan Febert 8 May 2024, 21:49

View original

2 replies

Userlevel 6
Badge +3

Hi @benb1977,

There is not settings for it, the only rule is the two extensions need to have different names or namespaces.

using PX.Data;
using PX.Objects.SO;

// First customization
namespace PX.Objects.SO
{
public class SOOrderEntryExt : PXGraphExtension<SOOrderEntry>
{

}
}

// Second customization, same Namespace, different Name
namespace PX.Objects.SO
{
public class SOOrderEntryAnotherExt : PXGraphExtension<SOOrderEntry>
{

}
}

// Third customization, same Name, different Namespace
namespace PX.Objects.AnotherNamespace
{
public class SOOrderEntryExt : PXGraphExtension<SOOrderEntry>
{

}
}

 

Thanks @Zoltan Febert.

Yeah that’s what I did. I had the classes as defined below but it crashed the server. The other thing that may be a problem is the fact that I’m actually programming on a rebranded Acumatica product called ‘MYOB Advanced’ here in Australia. I didn’t think there would be any difference in the way customisations are coded, but that seems to be the only explanation.

// First customisation package
namespace PX.Objects.SO
{
public class SOOrderEntry_Extension : PXGraphExtension<SOOrderEntry>
{

}
}

// Second customisation package
namespace PX.Objecs.SO
{
public class SOOrderEntry_PopupExtension : PXGraphExtension<SOOrderEntry>
{

}
}

 

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