I am trying to add an Action to the top of my custom form, but I cannot get it to show.
In the screen editor, it shows the action
My goal is to run a process when the action is clicked.
Here is my graph:
namespace QTCAuditReporting
{
public class QTCAuditReportV3 : PXGraph<QTCAuditReportV3>
{
public PXFilter<QTCAuditHistoryReportFilter> Filter;
public SelectFrom<QTCAuditHistoryReportView>.View RecordsToAdd;
public SelectFrom<QTCAuditHistoryParameters>.View Parameters;
[Serializable]
[PXHidden]
public class QTCAuditHistoryReportFilter : IBqlTable
{
#region ScreenID
[PXString(8, IsFixed = true, InputMask = "")]
[PXDefault]
[PXUIField(DisplayName = "Screen ID", Required = true)]
[PXSelector(typeof(Search5<AUAuditTable.screenID,
InnerJoin<SiteMap, On<SiteMap.screenID, Equal<AUAuditTable.screenID>>>,
Where<AUAuditTable.isActive, Equal<True>>,
Aggregate<GroupBy<AUAuditTable.screenID>>>),
typeof(AUAuditTable.screenID),
typeof(SiteMap.title),
DescriptionField = typeof(SiteMap.title))]
public virtual string ScreenID { get; set; }
public abstract class screenID : PX.Data.BQL.BqlString.Field<screenID> { }
#endregion
#region StartDate
[PXDate]
[PXUIField(DisplayName = "Start Date", Required = true)]
[PXDefault(typeof(AccessInfo.businessDate))]
public virtual DateTime? StartDate { get; set; }
public abstract class startDate : PX.Data.BQL.BqlDateTime.Field<startDate> { }
#endregion
#region EndDate
[PXDate]
[PXUIField(DisplayName = "End Date", Required = true)]
[PXDefault(typeof(AccessInfo.businessDate))]
public virtual DateTime? EndDate { get; set; }
public abstract class endDate : PX.Data.BQL.BqlDateTime.Field<endDate> { }
#endregion
#region AccessHistory
[PXBool]
[PXUIField(DisplayName = "Access History (Override Screen ID)")]
public virtual bool? AccessHistory { get; set; }
public abstract class accessHistory : PX.Data.BQL.BqlBool.Field<accessHistory> { }
#endregion
#region SelectedScreenID
[PXString(8, IsFixed = true, InputMask = "")]
public virtual string SelectedScreenID { get; set; }
public abstract class selectedScreenID : PX.Data.BQL.BqlString.Field<selectedScreenID> { }
#endregion
}
public PXAction<QTCAuditHistoryParameters> GetData;
[PXButton(CommitChanges = true)]
[PXUIField(DisplayName = "GET DATA", Enabled = true)]
protected virtual void GetDataSet()
{
QTCAuditHistoryReportFilter filter = Filter.Current;
if (filter != null && (!string.IsNullOrEmpty(filter.ScreenID) || filter.AccessHistory == true) && filter.StartDate != null && filter.EndDate != null)
{
if (filter.AccessHistory == true)
{
Filter.Current.SelectedScreenID = "SM201020";
filter.ScreenID = "SM201020";
}
QTCAuditHistoryParameters auditHistoryParameters = new QTCAuditHistoryParameters
{
ScreenID = Filter.Current.SelectedScreenID,
StartDate = Filter.Current.StartDate,
EndDate = Filter.Current.EndDate.Value.AddDays(1).AddTicks(-1)
};
Parameters.Update(auditHistoryParameters);
this.Actions.PressSave();
GetNewDataset(Filter.Current);
}
}
This is the ASPX
<%@ Page Language="C#" MasterPageFile="~/MasterPages/FormView.master" AutoEventWireup="true" ValidateRequest="false" CodeFile="QT401050.aspx.cs" Inherits="Page_QT401050" Title="Untitled Page" %>
<%@ MasterType VirtualPath="~/MasterPages/FormView.master" %>
<asp:Content ID="cont1" ContentPlaceHolderID="phDS" Runat="Server">
<px:PXDataSource ID="ds" runat="server" Visible="True" Width="100%"
TypeName="QTCAuditReporting.QTCAuditReportV3"
PrimaryView="Filter"
>
<CallbackCommands>
<px:PXDSCallbackCommand Visible="true" CommitChanges="true" Name="GetData">
</px:PXDSCallbackCommand>
</CallbackCommands>
</px:PXDataSource>
</asp:Content>
<asp:Content ID="cont2" ContentPlaceHolderID="phF" Runat="Server">
<px:PXFormView ID="form" runat="server" DataSourceID="ds" DataMember="Filter" Width="100%" AllowAutoHide="false">
<Template>
<px:PXLayoutRule ID="PXLayoutRule1" runat="server" StartRow="True"></px:PXLayoutRule>
<px:PXSelector runat="server" ID="CstPXSelector1" DataField="ScreenID" ></px:PXSelector>
<px:PXLayoutRule runat="server" ID="CstPXLayoutRule2" StartRow="True" ></px:PXLayoutRule>
<px:PXCheckBox runat="server" ID="CstPXCheckBox3" DataField="AccessHistory" ></px:PXCheckBox>
<px:PXLayoutRule runat="server" ID="CstPXLayoutRule4" StartRow="True" ></px:PXLayoutRule>
<px:PXDateTimeEdit runat="server" ID="CstPXDateTimeEdit5" DataField="StartDate" ></px:PXDateTimeEdit>
<px:PXLayoutRule runat="server" ID="CstPXLayoutRule6" StartRow="True" ></px:PXLayoutRule>
<px:PXDateTimeEdit runat="server" ID="CstPXDateTimeEdit7" DataField="EndDate" /></Template>
<AutoSize Container="Window" Enabled="True" MinHeight="200" ></AutoSize>
</px:PXFormView>
</asp:Content>
Â
I have tried each of the DACs in the PXAction (QTCAuditHistoryReportFilter, QTCAuditHistoryParameters) but no luck.
I am at a loss.