Skip to main content
Solved

Fields from Joined DACs are empty on Create Purchase Orders screen


MichaelShirk
Captain II
Forum|alt.badge.img+4

Either this is a bug, or I’m missing something simple.

On the PO505000 Create Purchase Orders Screen, fields from joined DACs are always empty.
Controls for Joined Data Fields

This works on other grids, and I don’t see any difference on the Create Production Orders screen, but it’s not working and a lot of the columns on the screen are empty.

Any Ideas?

For example, the customer name column is added, and the column is visible on the grid, but is always empty.

 

Best answer by MichaelShirk

I managed to get the Production Order status to display by overriding a bunch of stuff from the POCreateAMExtension in my own extension. However, sorting and filtering wasn’t working. 

Turns out I was overcomplicating it. Since the AMProdMatlSplitPlan table is already being joined to the query inside the POCreateAMExtension extension and it contains Order Type and ProdOrdID fields, it could be referenced by a PXDBScalar attribute on an unbound DAC extension field on the main POFixedDemand table. I didn’t need a graph extension at all.

This works perfectly.
 

 

View original
Did this topic help you find an answer to your question?

8 replies

MichaelShirk
Captain II
Forum|alt.badge.img+4
  • Author
  • Captain II
  • 132 replies
  • January 9, 2025

Has anyone else noticed this behavior? 
Our purchasing manager really needs visibility into some of this data available in the linked columns, but we’re not able to show it because the columns are empty, even if we add them to the grid..


darylbowman
Captain II
Forum|alt.badge.img+13

This screen uses a PXFieldScope in the data view delegate:

public virtual PXResultset<POFixedDemand> SelectFromFixedDemandView()
{
    //...
    using (new PXFieldScope(query, GetFixedDemandFieldScope()))
    {
        //...
    }
    //...
}

I believe, in practicality, this means that only the specified fields will be returned:

public virtual IEnumerable<Type> GetFixedDemandFieldScope()
{
    yield return typeof(POFixedDemand);
    yield return typeof(Vendor.bAccountID);
    yield return typeof(Vendor.curyID);
    yield return typeof(Vendor.termsID);
    yield return typeof(POVendorInventory.recordID);
    yield return typeof(POVendorInventory.lastPrice);
    yield return typeof(POVendorInventory.addLeadTimeDays);
    yield return typeof(CRLocation.locationID);
    yield return typeof(CRLocation.vLeadTime);
    yield return typeof(CRLocation.vCarrierID);
    yield return typeof(SOOrder.orderType);
    yield return typeof(SOOrder.orderNbr);
    yield return typeof(SOOrder.customerID);
    yield return typeof(SOOrder.customerLocationID);
    yield return typeof(SOOrder.noteID);
    yield return typeof(SOOrder.curyID);
    yield return typeof(SOOrder.branchID);
    yield return typeof(SOLine.orderType);
    yield return typeof(SOLine.orderNbr);
    yield return typeof(SOLine.lineNbr);
    yield return typeof(SOLine.unitPrice);
    yield return typeof(SOLine.inventoryID);
    yield return typeof(SOLine.uOM);
    yield return typeof(SOLine.noteID);
}

Although, if this is correct, in theory, you could override the GetFixedDemandFieldScope and return additional fields.


MichaelShirk
Captain II
Forum|alt.badge.img+4
  • Author
  • Captain II
  • 132 replies
  • February 20, 2025

@darylbowman I tried this, but it didn’t work. 
After doing more digging I’m more confused than I was before. 
 

I don’t want to copy-paste all the code here, but they’re doing something strange that I haven’t seen before.
The data view query joins multiple other tables (SOOrder for example), and as you mentioned, the PXFieldScope is used to restrict the results to those specific fields. However, for all I can tell the data view delegate operates on, and returns only a POFixedDemand object… 

It would be super helpful to get some insight on this. 
All I really need is to add the AMProdItem.statusID field to this screen. We don’t create purchase orders for custom order prod materials until the production order hits the “Released” status, so we need to make that visible for filtering purposes.

What I ultimately would like to know is, will it be better to create a “Clone” of this screen and implement it the way we want it, or is it feasible to override all the internals necessary to also include the AMProdItem.statusID field on this grid?

 

Regards,


darylbowman
Captain II
Forum|alt.badge.img+13
// Acuminator disable once PX1016 ExtensionDoesNotDeclareIsActiveMethod extension should be constantly active
public class POCreateExt : PXGraphExtension<POCreate>
{
    public delegate IEnumerable<Type> GetFixedDemandFieldScopeDelegate();
    [PXOverride]
    public virtual IEnumerable<Type> GetFixedDemandFieldScope(GetFixedDemandFieldScopeDelegate baseMethod)
    {
        foreach (var type in baseMethod())
            yield return type;

        // Add fields or tables here
        yield return typeof(SOOrder);
    }
}

This works for me:

(before)

 

 

(after)

 


MichaelShirk
Captain II
Forum|alt.badge.img+4
  • Author
  • Captain II
  • 132 replies
  • February 20, 2025

@darylbowman  Thanks for responding again.
This is still not working in my instance. 
I believe this is being affected by the fact that we have the manufacturing edition, which adds a graph extension that overrides a bunch of these virtual methods.

I’m in over my head and don’t understand how to go about making additional modifications to this! 
I’ll have to do more studying on how to work with multiple graph extensions that need to modify the same logic…..


darylbowman
Captain II
Forum|alt.badge.img+13

Try this:

// Acuminator disable once PX1016 ExtensionDoesNotDeclareIsActiveMethod extension should be constantly active
public class POCreateAMExtension_Ext : PXGraphExtension<POCreateAMExtension, POCreate>
{
    public delegate IEnumerable<Type> GetFixedDemandFieldScopeDelegate();
    [PXOverride]
    public virtual IEnumerable<Type> GetFixedDemandFieldScope(GetFixedDemandFieldScopeDelegate baseMethod)
    {
        foreach (var type in baseMethod())
            yield return type;

        // Add fields or tables here
        yield return typeof(SOOrder);
    }
}

 


MichaelShirk
Captain II
Forum|alt.badge.img+4
  • Author
  • Captain II
  • 132 replies
  • Answer
  • February 21, 2025

I managed to get the Production Order status to display by overriding a bunch of stuff from the POCreateAMExtension in my own extension. However, sorting and filtering wasn’t working. 

Turns out I was overcomplicating it. Since the AMProdMatlSplitPlan table is already being joined to the query inside the POCreateAMExtension extension and it contains Order Type and ProdOrdID fields, it could be referenced by a PXDBScalar attribute on an unbound DAC extension field on the main POFixedDemand table. I didn’t need a graph extension at all.

This works perfectly.
 

 


Chris Hackett
Community Manager
Forum|alt.badge.img
  • Acumatica Community Manager
  • 2750 replies
  • February 22, 2025

Thank you for sharing your solution with the community ​@MichaelShirk!


Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings