How to get the default value for the Transaction Period and Financial Period based on a date field entered and branch selector
Hello,
I have a customization form that I need to fill “Transaction Period” and company’s “Financial Period” by defult from a date field and the selected branch but I can not make it work. I reviewed a couple Acumatica’s owen screens and I’m doing exctly the same (at least I think so) but these two fields are not filled by default. Any help appreciated. Here is my little Graph, partial DAC and Partial ASPX.
namespace MyCustom
}
// Graph
public class PMCashflowProjectionEntry : PXGraph<PMCashflowProjectionEntry, PMCashflowProjection>
{
public PXSelect<PMCashflowProjection> CashflowProjections; public PXSelect<PMCashflowProjectionSchedule, Where<PMCashflowProjectionSchedule.projectID, Equal<Current<PMCashflowProjection.projectID>>>> CashflowProjectionSchedules; } //Partial Header DAC public class PMCashflowProjection : IBqlTable { #region BranchID public abstract class branchID : PX.Data.BQL.BqlInt.Field<branchID> { } protected Int32? _BranchID; pBranch()] dPXForeignReference(typeof(Field<branchID>.IsRelatedTo<Branch.branchID>))] tPXUIField(DisplayName = "Branch", Visibility = PXUIVisibility.SelectorVisible, Required = true, Enabled = true, Visible = true)] public virtual Int32? BranchID { get { return this._BranchID; } set { this._BranchID = value; } } #endregion } //Partial Detail DAC public class PMCashflowProjectionSchedule : IBqlTable { #region Date public abstract class date : PX.Data.BQL.BqlDateTime.Field<date> { } protected DateTime? _Date; iPXDBDate()] pPXDefault(typeof(AccessInfo.businessDate), PersistingCheck = PXPersistingCheck.Nothing)] aPXUIField(DisplayName = "Date", Visibility = PXUIVisibility.SelectorVisible, Required = true, Enabled = true, Visible = true, IsReadOnly = false)] public virtual DateTime? Date { get { return this._Date; } set { this._Date = value; } } #endregion #region TranPeriodID public abstract class tranPeriodID : PX.Data.BQL.BqlString.Field<tranPeriodID> { } protected String _TranPeriodID; PXDefault()] rPeriodID( searchType: null, sourceType: typeof(date), defaultType: null, redefaultOnDateChanged: true)] tPXUIField(DisplayName = "Tran. Period", Visibility = PXUIVisibility.SelectorVisible, Required = true, Enabled = true, Visible = true)] public virtual String TranPeriodID { get { return this._TranPeriodID; } set { this._TranPeriodID = value; } } #endregion #region FinPeriodID public abstract class finPeriodID : PX.Data.BQL.BqlString.Field<finPeriodID> { } protected String _FinPeriodID; >FinPeriodID( sourceType: typeof(date), branchSourceType: typeof(PMCashflowProjection.branchID), masterFinPeriodIDType: typeof(tranPeriodID), headerMasterFinPeriodIDType: typeof(tranPeriodID), redefaultOnDateChanged: true)] public virtual String FinPeriodID { get { return this._FinPeriodID; } set { this._FinPeriodID = value; } } #endregion } } { //Partial ASPX //Form <px:PXSegmentMask runat="server" ID="edBranchID" DataField="BranchID" CommitChanges="True" AutoRefresh="True" /> //Grid Clumns <px:PXGridColumn DataField="Date" Width="80" CommitChanges="True" ></px:PXGridColumn> <px:PXGridColumn DataField="TranPeriodID" Width="80" CommitChanges="True" ></px:PXGridColumn> <px:PXGridColumn DataField="FinPeriodID" Width="80" CommitChanges="True" ></px:PXGridColumn> // Grid Row Template <px:PXDateTimeEdit runat="server" ID="edDate" DataField="Date" CommitChanges="True" AutoRefresh="True" ></px:PXDateTimeEdit> <px:PXMaskEdit runat="server" ID="edTranPeriodID" DataField="TranPeriodID" CommitChanges="True" Size="s" ></px:PXMaskEdit> <px:PXMaskEdit runat="server" ID="edFinPeriodID" DataField="FinPeriodID" CommitChanges="True" Size="s" ></px:PXMaskEdit> }