真正简单却令人生厌的问题。
1)创建一个DB脚本以将字段添加到数据库中并发布。 2)根据更改后的表创建一个新的DAC。 3)创建一个新的屏幕和图形。 4)更改图形以指向在#2中创建的DAC。
问题:网格为空,我无法显示任何内容。
从数据库加载生成的DAC(无更改):
[Serializable]
public class INItemXRef : IBqlTable
{
#region InventoryID
[PXDBInt(IsKey = true)]
[PXUIField(DisplayName = "Inventory ID")]
public virtual int? InventoryID { get; set; }
public abstract class inventoryID : IBqlField { }
#endregion
#region SubItemID
[PXDBInt(IsKey = true)]
[PXUIField(DisplayName = "Sub Item ID")]
public virtual int? SubItemID { get; set; }
public abstract class subItemID : IBqlField { }
#endregion
#region AlternateType
[PXDBString(4, IsKey = true, InputMask = "")]
[PXUIField(DisplayName = "Alternate Type")]
public virtual string AlternateType { get; set; }
public abstract class alternateType : IBqlField { }
#endregion
#region BAccountID
[PXDBInt(IsKey = true)]
[PXUIField(DisplayName = "BAccount ID")]
public virtual int? BAccountID { get; set; }
public abstract class bAccountID : IBqlField { }
#endregion
#region AlternateID
[PXDBString(50, IsKey = true, IsUnicode = true, InputMask = "")]
[PXUIField(DisplayName = "Alternate ID")]
public virtual string AlternateID { get; set; }
public abstract class alternateID : IBqlField { }
#endregion
#region Descr
[PXDBString(256, IsUnicode = true, InputMask = "")]
[PXUIField(DisplayName = "Descr")]
public virtual string Descr { get; set; }
public abstract class descr : IBqlField { }
#endregion
#region Uom
[PXDBString(6, IsUnicode = true, InputMask = "")]
[PXUIField(DisplayName = "Uom")]
public virtual string Uom { get; set; }
public abstract class uom : IBqlField { }
#endregion
#region CreatedByID
[PXDBCreatedByID()]
public virtual Guid? CreatedByID { get; set; }
public abstract class createdByID : IBqlField { }
#endregion
#region CreatedByScreenID
[PXDBCreatedByScreenID()]
public virtual string CreatedByScreenID { get; set; }
public abstract class createdByScreenID : IBqlField { }
#endregion
#region CreatedDateTime
[PXDBDate()]
[PXUIField(DisplayName = "Created Date Time")]
public virtual DateTime? CreatedDateTime { get; set; }
public abstract class createdDateTime : IBqlField { }
#endregion
#region LastModifiedByID
[PXDBLastModifiedByID()]
public virtual Guid? LastModifiedByID { get; set; }
public abstract class lastModifiedByID : IBqlField { }
#endregion
#region LastModifiedByScreenID
[PXDBLastModifiedByScreenID()]
public virtual string LastModifiedByScreenID { get; set; }
public abstract class lastModifiedByScreenID : IBqlField { }
#endregion
#region LastModifiedDateTime
[PXDBDate()]
[PXUIField(DisplayName = "Last Modified Date Time")]
public virtual DateTime? LastModifiedDateTime { get; set; }
public abstract class lastModifiedDateTime : IBqlField { }
#endregion
#region Tstamp
[PXDBTimestamp()]
[PXUIField(DisplayName = "Tstamp")]
public virtual byte[] Tstamp { get; set; }
public abstract class tstamp : IBqlField { }
#endregion
#region UsrNoteID
[PXDBGuid()]
[PXUIField(DisplayName = "Usr Note ID")]
public virtual Guid? UsrNoteID { get; set; }
public abstract class usrNoteID : IBqlField { }
#endregion
#region UsrTemp
[PXDBString(20, IsUnicode = true, InputMask = "")]
[PXUIField(DisplayName = "Usr Temp")]
public virtual string UsrTemp { get; set; }
public abstract class usrTemp : IBqlField { }
#endregion
#region Noteid
[PXDBGuid()]
[PXUIField(DisplayName = "Noteid")]
public virtual Guid? Noteid { get; set; }
public abstract class noteid : IBqlField { }
#endregion
}
屏幕图(仅更改为使用上面的DAC的视图):
using System;
using PX.Data;
namespace PennAirSales
{
public class INItemXRefBLC : PXGraph<INItemXRefBLC>
{
public PXSave<INItemXRef> Save;
public PXCancel<INItemXRef> Cancel;
public PXFilter<INItemXRef> MasterView;
public PXFilter<INItemXRef> DetailsView;
//[Serializable]
//public class MasterTable : IBqlTable
//{
//}
//[Serializable]
//public class DetailsTable : IBqlTable
//{
//}
}
ASPX(无更改)
<%@ Page Language="C#" MasterPageFile="~/MasterPages/ListView.master" AutoEventWireup="true" ValidateRequest="false" CodeFile="IN202599.aspx.cs" Inherits="Page_IN202599" Title="Untitled Page" %>
<%@ MasterType VirtualPath="~/MasterPages/ListView.master" %>
<asp:Content ID="cont1" ContentPlaceHolderID="phDS" Runat="Server">
<px:PXDataSource ID="ds" runat="server" Visible="True" Width="100%"
TypeName="PennAirSales.INItemXRefBLC"
PrimaryView="MasterView"
>
<CallbackCommands>
</CallbackCommands>
</px:PXDataSource>
</asp:Content>
<asp:Content ID="cont2" ContentPlaceHolderID="phL" runat="Server">
<px:PXGrid ID="grid" runat="server" DataSourceID="ds" Width="100%" Height="150px" SkinID="Primary" AllowAutoHide="false">
<Levels>
<px:PXGridLevel DataMember="DetailsView">
<Columns>
<px:PXGridColumn DataField="AlternateID" Width="180" />
<px:PXGridColumn DataField="AlternateType" Width="70" />
<px:PXGridColumn DataField="Descr" Width="280" />
<px:PXGridColumn DataField="InventoryID" Width="70" />
<px:PXGridColumn DataField="BAccountID" Width="70" />
<px:PXGridColumn DataField="NoteID" Width="70" /></Columns>
</px:PXGridLevel>
</Levels>
<AutoSize Container="Window" Enabled="True" MinHeight="150" />
<ActionBar >
</ActionBar>
</px:PXGrid>
</asp:Content>
这太简单了,我无法理解为什么没有数据被提取(可以在通用查询中看到数据很好),似乎很明显我很想念...
答案 0 :(得分:1)
您需要的视图不是过滤器(PXSelect与PXFilter)
尝试:
public PXSelect<INItemXRef> DetailsView;