1

everybody. I' m a acumatica version 4. 10. I' m asking you today about a problem. I had this error trying to create a new page for the website.

I added a project for this section, which includes all the files as shown below enter image description here The error occurred when i tried to access the new page that just created enter image description here

My new page

<%@ Page Language="C#" MasterPageFile="~/MasterPages/FormDetail.master" AutoEventWireup="true" ValidateRequest="false" CodeFile="PO510000.aspx.cs" Inherits="Page_PO510000" Title="Untitled Page" %>
<%@ MasterType VirtualPath="~/MasterPages/FormDetail.master" %>

<asp:Content ID="cont1" ContentPlaceHolderID="phDS" Runat="Server">
    <px:PXDataSource ID="ds" runat="server" Visible="True" Width="100%" PrimaryView="CodeGiftRecords" TypeName="SunfixInquiry.POCodeGiftMaint">
        <CallbackCommands>
            <px:PXDSCallbackCommand Name="Save" CommitChanges="True" />
            <px:PXDSCallbackCommand Name="Insert" CommitChanges="True" Visible="false" />
            <px:PXDSCallbackCommand Name="Delete" CommitChanges="True" Visible="false" />
            <px:PXDSCallbackCommand Name="First" CommitChanges="True" Visible="false" />
            <px:PXDSCallbackCommand Name="Previous" CommitChanges="True" Visible="false" />
            <px:PXDSCallbackCommand Name="Next" CommitChanges="True" Visible="false" />
            <px:PXDSCallbackCommand Name="Last" CommitChanges="True" Visible="false" />
        </CallbackCommands>
    </px:PXDataSource>
</asp:Content>
<asp:Content ID="cont2" ContentPlaceHolderID="phF" Runat="Server">
    <px:PXFormView ID="form" runat="server" DataSourceID="ds" Style="z-index: 100" 
        Width="100%">
        <Template>
            <px:PXLayoutRule runat="server" StartRow="True"/>
        </Template>
    </px:PXFormView>
</asp:Content>
<asp:Content ID="cont3" ContentPlaceHolderID="phG" Runat="Server">
    <px:PXGrid ID="grid" runat="server" DataSourceID="ds" Style="z-index: 100" 
        Width="100%" Height="150px" SkinID="Details" TabIndex="2200">
        <Levels>
            <px:PXGridLevel DataKeyNames="CodeGift" DataMember="CodeGiftRecords">
                <RowTemplate>
                    <px:PXCheckBox ID="edDisable" runat="server" CommitChanges="True" DataField="Disable" Text="Disable">
                    </px:PXCheckBox>
                </RowTemplate>
                <Columns>
                    <px:PXGridColumn DataField="CodeGift">
                    </px:PXGridColumn>
                    <px:PXGridColumn DataField="Name">
                    </px:PXGridColumn>
                    <px:PXGridColumn DataField="Disable" TextAlign="Center" Type="CheckBox" DataType="Boolean">
                    </px:PXGridColumn>
                </Columns>
            </px:PXGridLevel>
        </Levels>
        <AutoSize Container="Window" Enabled="True" MinHeight="150" />
         <ActionBar ActionsText="False">
        </ActionBar>
        <Mode AllowUpload="True" />
    </px:PXGrid>
</asp:Content>

My DAC

    <Graph ClassName="POCodeGift" Source="#CDATA" IsNew="True" FileType="NewDac">
        <CDATA name="Source"><![CDATA[using System;
    using PX.Data;

    namespace SunfixInquiry
    {
      [Serializable]
      public class POCodeGift: IBqlTable
      {


        #region CodeGift

        [PXDBString(10, IsKey = true, InputMask = "")]
        [PXUIField(DisplayName = "Code Gift")]
        public string CodeGift { get; set; }

        public class codeGift : IBqlField{}

        #endregion


        #region Name

        [PXDBString(IsUnicode = true, InputMask = "")]
        [PXUIField(DisplayName = "Name")]
        public string Name { get; set; }

        public class name : IBqlField{}

        #endregion


        #region Disable

        [PXDBBool()]
        [PXUIField(DisplayName = "Disable")]
        public bool? Disable { get; set; }

        public class disable : IBqlField{}

        #endregion


        #region CreatedByID


        [PXDBCreatedByID()]
        public Guid? CreatedByID { get; set; }

        public class createdByID : IBqlField{}

        #endregion


        #region CreatedByScreenID


        [PXDBCreatedByScreenID()]
        public string CreatedByScreenID { get; set; }

        public class createdByScreenID : IBqlField{}

        #endregion


        #region CreatedDateTime

        [PXDBCreatedDateTime]
        [PXUIField(DisplayName = "Created Date Time")]
        public DateTime? CreatedDateTime { get; set; }

        public class createdDateTime : IBqlField{}

        #endregion


        #region LastModifiedByID


        [PXDBLastModifiedByID()]
        public Guid? LastModifiedByID { get; set; }

        public class lastModifiedByID : IBqlField{}

        #endregion


        #region LastModifiedByScreenID


        [PXDBLastModifiedByScreenID()]
        public string LastModifiedByScreenID { get; set; }

        public class lastModifiedByScreenID : IBqlField{}

        #endregion


        #region LastModifiedDateTime

        [PXDBLastModifiedDateTime()]
        [PXUIField(DisplayName = "Last Modified Date Time")]
        public DateTime? LastModifiedDateTime { get; set; }

        public class lastModifiedDateTime : IBqlField{}

        #endregion


        #region Tstamp

        [PXDBTimestamp()]
        [PXUIField(DisplayName = "Tstamp")]
        public byte[] Tstamp { get; set; }

        public class tstamp : IBqlField{}

        #endregion

      }
    }]]></CDATA>
    </Graph>

My Graph


<Graph ClassName="POCodeGiftMaint" Source="#CDATA" IsNew="True" FileType="NewGraph">
    <CDATA name="Source"><![CDATA[using System;
using PX.Data;

namespace SunfixInquiry
{
  [PXCustomization] 
  public class POCodeGiftMaint: PXGraph<POCodeGiftMaint,POCodeGift>
  {
       [PXImport(typeof(POCodeGift))]
        public PXSelect<POCodeGift> CodeGiftRecords;
    #region Event Handlers

    #endregion
  }
}]]></CDATA>
</Graph>

Please tell me what i' m missing, many thanks

Brendan
  • 5,428
  • 2
  • 17
  • 33
Ninh Nguyen
  • 27
  • 1
  • 3

1 Answers1

1

The ASPX markup states that CodeGiftRecords is thePrimaryView and the DataMember of the grid. Does your BLC have CodeGiftRecords specified, or is it named something else? The ASPX also shows a FormView tag without a DataMember. Is this page handling Master/Detail information, or did you intend to use a ListView instead?

FarmerJohn
  • 367
  • 2
  • 8
  • Hi @FarmerJohn , Sorry i answered late, i fixed it, thank you very much. But i can ask you another question ?, i' ve created a new screen, but sometimes the system will automatically create a record with null value. And the screen displays a blank line at the top of the grid . How can i stop the system from doing this ? – Ninh Nguyen Dec 13 '19 at 23:18
  • Try adding the tag before the ending tag. – FarmerJohn Dec 16 '19 at 11:19
  • It woked for me . Thanks you so much ! – Ninh Nguyen Dec 20 '19 at 10:55