Hi Everyone,
I’m currently customizing the ProjectEntry graph where I added a custom table to the tab. In my custom table, I have defined a date field, where I declared a default date [PXDefault(typeof(AccessInfo.businessDate))], but when I create a new empty project, I want to fill the date field with current date. Can anyone help me how to implement this?
#Custom field from a custom table
#region IBqlTable
[PXDefault(typeof(AccessInfo.businessDate))]
[PXDBDate()]
[PXUIField(DisplayName = "Date MOB Promised", Required = true)]
public virtual DateTime? DateMobPromised { get; set; }
public abstract class dateMobPromised : PX.Data.BQL.BqlDateTime.Field<dateMobPromised> { }
#endregion
#region Data View
public SelectFrom<ProjectCustomFields>.
Where<ProjectCustomFields.contractID.IsEqual<PMProject.contractID.FromCurrent>>.View MyProjectCustomFields;
#endregion
I have tried to override the Initialize method but still no luck.
public PXSelect<ProjectCustomFields> MyProjectCustomFields;
public override void Initialize()
{
base.Initialize();
ProjectCustomFields anotherRecord = new ProjectCustomFields();
anotherRecord.ToBeReleased = DateTime.Now;
// Acuminator disable once PX1059 ChangesInPXCacheDuringPXGraphInitialization [Justification]
MyProjectCustomFields.Insert(anotherRecord);
}
It is very much appreciated if you can help me.
Thank you