Skip to main content
Question

How to Override the PMTaskTotal.CuryExpense Field Value in the Project Screen?

  • December 3, 2025
  • 1 reply
  • 21 views

Sagar Greytrix
Captain II
Forum|alt.badge.img+3

Hi Team,


I want to override the PMTaskTotal.CuryExpense field, which is available on the Project screen.

 

I have tried several events such as RowSelected, RowSelecting, RowPersisting, RowPersisted, and RowInserted, but I am still not getting the expected result. The field value is not changing.

 

Currently, I have added a hardcoded value just to test the event, but it still doesn’t update.

Can someone please assist me with how I can customize or override this field properly?

 

using PX.Data;

namespace PX.Objects.PM
{
    public class ProjectEntry_Ext : PXGraphExtension<PX.Objects.PM.ProjectEntry>
    {
        #region Event Handlers

        // This will modify the value when it's selected/displayed
        protected void PMTaskTotal_CuryExpense_FieldSelecting(PXCache cache, PXFieldSelectingEventArgs e)
        {
            if (e.Row is PMTaskTotal row && e.ReturnValue != null)
            {
                decimal currentValue = (decimal?)e.ReturnValue ?? 0m;
                e.ReturnValue = currentValue + 1000m;
            }
        }

        #endregion
    }
}

 

1 reply

Forum|alt.badge.img+1

Hi ​@Sagar Greytrix 

On the ASPX page, the field for displaying PMTaskTotal.CuryExpense is disabled. Therefore, no event handlers are triggered for this field.

<px:PXFormView ID="form" runat="server" DataSourceID="ds" Style="z-index: 100" Width="100%" DataMember="Project" Caption="Project Summary" FilesIndicator="True"
NoteIndicator="True" BPEventsIndicator="true" LinkPage="">
<Template>
...
<px:PXNumberEdit ID="edExpense" runat="server" DataField="TaskTotals.CuryExpense" Enabled="False" ></px:PXNumberEdit>
...
</Template>
</px:PXFormView>

The earliest event where you can intervene in the process and change the CuryExpense value to the desired one is RowSelecting for PMTaskTotal. At least it worked for me without any issues. 

        protected void _(Events.RowSelecting<PMTaskTotal> e)
{
if (e.Row is PMTaskTotal row)
{
decimal currentValue = (decimal?)row.CuryExpense ?? 0m;
e.Cache.SetValue<PMTaskTotal.curyExpense>(row, currentValue + 1000m);
}
}

I think with this information, you should be able to implement the business logic you need without any trouble.

But …

I looked at the view from which the data is displayed in the Totals section.

public PXSelectGroupBy<PMTaskTotal, Where<PMTaskTotal.projectID, Equal<Current<PMProject.contractID>>>,
Aggregate<Sum<PMTaskTotal.asset, Sum<PMTaskTotal.liability, Sum<PMTaskTotal.income, Sum<PMTaskTotal.expense,
Sum<PMTaskTotal.curyAsset, Sum<PMTaskTotal.curyLiability, Sum<PMTaskTotal.curyIncome, Sum<PMTaskTotal.curyExpense>>>>>>>>>> TaskTotals;


In my opinion, it would be correct to override this view and try to change the curyExpense value in it. (For example, create a Data View Delegate for this view)

Hope this was helpful!