All,
A new opportunity defaults the Estimated Close Date to @Today. My sales team has asked me to default this to @Today + 14 (ie, two weeks).

So I went here --

And created this --

I was going to change it here, but instead, Google Gemini recommended adding this C# file to a customization project:
using PX.Data;
using System;
namespace MyCustomizationProject
{
public class CROpportunityExt : PXCacheExtension<PX.Objects.CR.CROpportunity>
{
#region UsrMyEstimatedCloseDate
[PXDBDate(BqlField = typeof(PX.Objects.CR.CROpportunity.closeDate))] // Corrected to use base field's BqlField
[PXDefault(typeof(CROpportunityExt.GetDefaultCloseDate), PersistingCheck = PXPersistingCheck.Nothing)] // Use a custom method for the default value
[PXMassUpdatableField]
[PXUIField(DisplayName = "Estimated Close Date", Visibility = PXUIVisibility.SelectorVisible)]
public virtual DateTime? UsrMyEstimatedCloseDate { get; set; }
public abstract class usrMyEstimatedCloseDate : PX.Data.BQL.BqlDateTime.Field<usrMyEstimatedCloseDate> { }
// Custom method to calculate the default close date
public class GetDefaultCloseDate : PX.Data.BQL.BqlMethod.WithParameters<PX.Objects.GL.DAC.Branch.branchID>
{
public override object Evaluate(PXCache cache, object item, params object[] parameters)
{
return PXTimeZoneInfo.Today.AddDays(14);
}
}
#endregion
}
}
Are either of these methods close to doing what I need to achieve?


