Skip to main content

Hello, I have made a change to the way in which credit checks work by extending SOOrderCustomerCredit. The following article helped a lot with this 

I’ve added breakpoints to my code and these are being hit when I enter a sales order, so I know my code is working. The problem is that when I look at the SOEntry graph I cannot see any reference to the SOOrderCustomerCredit class. In fact, when I search the Acumatica code the only references to SOOrderCustomerCredit seem to be where it is defined (inheriting from an abstract class called SOOrderCustomerCreditExtension). I cannot see where the Acumatica code actually uses the SOOrderCustomerCredit class.

Can anyone explain the link between SOEntry and SOOrderCustomerCredit please? 

 

 

Hi @stephenward03,

  1. SOOrderCustomerCredit is inherited from SOOrderCustomerCreditExtension
  2. SOOrderCustomerCreditExtension is inherited from CustomerCreditExtension
  3. CustomerCreditExtension is inherited from PXGraphExtension.

So, when SOOrderCustomerCredit is inherited from SOOrderCustomerCreditExtension<SOOrderEntry>, then it also inherited form a PXGraphExtension<SOOrderdenEntry>, and it creates the link between the two classes.

 

Long story short: SOOrderCustomerCredit is a graph extension of SOOrderEntry.


Thank you for responding, Very well explained and well formatted - I think I need to start using inline formatting too!

Following on from your answer that the SOOrderCustomerCredit is basically a graph extension of  SOOrderEntry, I guess it’s the events defined in the extension which are actually triggering the credit checks. 

The concern I have is that by looking through the code on SOOrderEntry there is no reference to SOOrderCustomerCredit so it’s quite difficult to know how credit checks are performed. For all I know there could be (and probably are) many other graph extensions which I’m not able to know about just from looking though graph code. 

Do you know if there are any tools (in VS or Acuminator) which can assist in mapping out the class structures in Acumatica?  


I don’t know if there is any tool for this, but you can use this small extension to write them to the trace.

using System;
using System.Collections;
using System.Collections.Generic;
using PX.Api;
using PX.Data;
using PX.Objects.SO;

namespace PX.Objects.ShowExtensions
{

// Acuminator disable once PX1016 ExtensionDoesNotDeclareIsActiveMethod extension should be constantly active
public class ShowExtensions : PXGraphExtension<SOOrderEntry>
{
public PXAction<SOOrder> WriteExtensionsToTrace;

PXButton]
PXUIField(DisplayName = "Write Extensions To Trace")]
public virtual IEnumerable writeExtensionsToTrace(PXAdapter adapter)
{
var list = new List<string>();
try
{
for (var i = 0; i < int.MaxValue; i++)
{
list.Add(Base.GetExtension(i).GetType().FullName);
}
}
catch (Exception e)
{
PXTrace.WriteInformation(list.JoinToString("\r\n"));
}
return adapter.Get();
}
}
}

 


Reply