Hello Team,
I've added custom fields to the Revenue Budget tab on the Project screen. I wrote code for the RowSelected event, but the values are not being saved in the database when I click the Save button in the Project Header. However, if I click the Revenue Budget tab any field within it, followed by the Save button, the values are saved properly.
Could you please assist me in finding a solution to save the field values without having to click on the Revenue Budget tab?
Custom Field Code:
public class PMBudgetExt : PXCacheExtension<PX.Objects.PM.PMBudget>
{
#region UsrPTDBilled
[PXDBDecimal]
[PXUIField(DisplayName="PTD Billed", Enabled = false)]
public virtual Decimal? UsrPTDBilled { get; set; }
public abstract class usrPTDBilled : PX.Data.BQL.BqlDecimal.Field<usrPTDBilled> { }
#endregion
}
Code File:
public class ProjectEntry_Extension : PXGraphExtension<PX.Objects.PM.ProjectEntry>
{
public static bool IsActive() => true;
protected virtual void _(Events.RowSelected<PMRevenueBudget> e)
{
var row = (PMRevenueBudget)e.Row;
if (row == null) return;
PMBudgetExt itemExt = PXCache<PMBudget>.GetExtension<PMBudgetExt>(row);
if (itemExt.UsrPTDBilled == null)
{
e.Cache.SetValueExt<PMBudgetExt.usrPTDBilled>(row,100);
}
}
Thank you.
Sagar