0
votes

Against the Project Task screen I have added a new tab with a grid on it.

I have created a custom table which holds a projectid and a taskid against it which I I use to filter my PXSelect against the graph extension.

When I switch to the tab the rows display there correctly then after a second they disappear? It like the Current.TaskId and Current.ProjectId loose there values or something. Please help

Heres how I set it up

My Graph Extension

    public class ProjectTaskEntryExt : PXGraphExtension<ProjectTaskEntry>
{

    public PXSelect<UsrMAXXTaskEmployees,
        Where<UsrMAXXTaskEmployees.projectID, Equal<Current<PMTask.projectID>>,
            And<UsrMAXXTaskEmployees.taskID, Equal<Current<PMTask.taskID>>>>> BudgetEmployees;





    #region Event Handlers

    protected void UsrMAXXTaskEmployees_RowInserting(PXCache cache, PXRowInsertingEventArgs e, PXRowInserting InvokeBaseHandler)
    {
        if (InvokeBaseHandler != null)
            InvokeBaseHandler(cache, e);
        var row = (UsrMAXXTaskEmployees)e.Row;

        if (row != null)
        {
            row.ProjectID = Base.Task.Current.ProjectID;
            row.TaskID = Base.Task.Current.TaskID;

        }
    }

    public override void Initialize()
    {
        base.Initialize();

    }


    #endregion
}

Here is my Custom dac for the table

    public class UsrMAXXTaskEmployees : IBqlTable
{

    #region Selected
    public abstract class selected : IBqlField
    { }
    [PXBool]
    [PXUIField(DisplayName = "Selected")]
    public virtual bool? Selected { get; set; }
    #endregion

    #region ID
    public abstract class iD : PX.Data.IBqlField
    {
    }
    protected int? _ID;
    [PXDBIdentity(IsKey = true)]
    [PXUIField(Enabled = false)]
    public virtual int? ID
    {
        get
        {
            return this._ID;
        }
        set
        {
            this._ID = value;
        }
    }
    #endregion

    #region EmployeeID
    public abstract class employeeId : PX.Data.IBqlField
    {
    }
    protected String _EmployeeId;
    [PXDBString()]
    [PXUIField(DisplayName = "Employee")]
    [PXSelector(
        typeof(Search<PX.Objects.EP.EPEmployee.acctCD>),
        typeof(PX.Objects.EP.EPEmployee.acctCD),
        typeof(PX.Objects.EP.EPEmployee.acctName),
        DescriptionField = typeof(PX.Objects.EP.EPEmployee.acctName))]
    public virtual String EmployeeId
    {
        get
        {
            return this._EmployeeId;
        }
        set
        {
            this._EmployeeId = value;
        }
    }
    #endregion

    #region StartDate
    public abstract class startDate : PX.Data.IBqlField
    {
    }
    protected DateTime? _StartDate;
    [PXDBDate()]
    [PXDefault(typeof(AccessInfo.businessDate))]
    [PXUIField(DisplayName = "Start Date")]
    public virtual DateTime? StartDate
    {
        get
        {
            return this._StartDate;
        }
        set
        {
            this._StartDate = value;
        }
    }
    #endregion

    #region EndDate
    public abstract class endDate : PX.Data.IBqlField
    {
    }
    protected DateTime? _EndDate;
    [PXDBDate()]
    [PXUIField(DisplayName = "End Date")]
    public virtual DateTime? EndDate
    {
        get
        {
            return this._EndDate;
        }
        set
        {
            this._EndDate = value;
        }
    }
    #endregion

    #region ProjectID
    public abstract class projectID : PX.Data.IBqlField
    {
    }
    protected int? _ProjectID;
    [PXDBInt()]
    [PXDBDefault(typeof(PX.Objects.PM.PMProject.contractID))]
    [PXUIField(DisplayName = "Project")]
    public virtual int? ProjectID
    {
        get
        {
            return this._ProjectID;
        }
        set
        {
            this._ProjectID = value;
        }
    }
    #endregion

    #region TaskID
    public abstract class taskID : PX.Data.IBqlField
    {
    }
    protected int? _TaskID;
    [PXDBInt()]
    [PXDefault(0)]
    [PXUIField(DisplayName = "Task")]
    public virtual int? TaskID
    {
        get
        {
            return this._TaskID;
        }
        set
        {
            this._TaskID = value;
        }
    }
    #endregion

}
2

2 Answers

1
votes

Please check if AutoSize is enabled for your grid and SkinID is set to DetailsInTab:

<px:PXGrid ID="gridNS" runat="server" SkinID="DetailsInTab" Width="100%" Height="150px" Caption="Mailings" AdjustPageSize="Auto" AllowPaging="True" DataSourceID="ds">
    <AutoSize Enabled="True" />
    <AutoCallBack Target="gridNR" Command="Refresh" />
    <Levels>
        <px:PXGridLevel DataMember=“NotificationSources" DataKeyNames="SourceID,SetupID">
            <Columns>
            ...
            </Columns>
        </px:PXGridLevel>
    </Levels>
</px:PXGrid>
0
votes

I set the height on the grid to 100% which is what the other tab grids are set to. But once I set it to a fixed value like 300px the rows didnt dispappear anymore.