我试图复制acumatica的类型(字段)的逻辑。我想在更改类型时重置所有字段,我不知道我是否错过了aspx中的任何配置但是它给了我这个错误"错误:在字段处理期间发生错误参考Nbr 。:错误:'参考Nbr。'在系统中找不到。"
这是我的代码:
DAC:
#region Type
public abstract class type : PX.Data.IBqlField
{
}
protected string _Type;
[PXDBString(15, IsKey = true, IsFixed = true)]
[PXDefault("Termination")]
[PXUIField(DisplayName = "Type")]
[PXStringList(
new string[] { "Termination", "Repossession", "Pretermination" },
new string[] { "Termination", "Repossession", "Pretermination" })]
public virtual string Type
{
get
{
return this._Type;
}
set
{
this._Type = value;
}
}
#endregion
#region ReferenceNbr
public abstract class referenceNbr : PX.Data.IBqlField
{
}
protected string _ReferenceNbr;
[PXDBString(20, IsUnicode = true, IsKey = true,
InputMask = ">CCCCCCCCCCCCCCCCCCCC")]
[PXUIField(DisplayName = "Reference Nbr.", Visibility = PXUIVisibility.SelectorVisible, TabOrder = 1)]
[PXSelector(
typeof(Search<Termination.referenceNbr,Where<Termination.terminateType,Equal<Current<Termination.terminateType>>>>),
typeof(Termination.referenceNbr),
typeof(Termination.status),
typeof(Termination.terminateType),
typeof(Termination.loanCD),
typeof(Termination.customerName),
typeof(Termination.customerLocation),
typeof(Termination.branchCD),
typeof(Termination.reasonCode),
typeof(Termination.description), Filterable = true, IsPrimaryViewCompatible = true)]
[AutoNumber(typeof(LSSetup.terminationNumSeqID), typeof(Termination.dateCreated))]
public virtual string ReferenceNbr
{
get
{
return this._ReferenceNbr;
}
set
{
this._ReferenceNbr = value;
}
}
#endregion
ASPX(屏幕):
<asp:Content ID="cont2" ContentPlaceHolderID="phF" runat="Server">
<px:PXFormView ID="form" runat="server" DataSourceID="ds" Style="z-index: 100"
Width="100%" DataMember="Terminations" TabIndex="1500" NoteIndicator="True"
FilesIndicator="True" ActivityIndicator="True" ActivityField="NoteActivity"
LinkIndicator="True" NotifyIndicator="True" DefaultControlID="edType">
<Template>
<px:PXLayoutRule runat="server" StartRow="True" ControlSize="S" LabelsWidth="S" StartColumn="True">
</px:PXLayoutRule>
<px:PXDropDown ID="edType" runat="server" DataField="Type">
</px:PXDropDown>
<px:PXSelector ID="edReferenceNbr" runat="server" DataField="ReferenceNbr">
</px:PXSelector>
<px:PXCheckBox runat="server" Text="IsHold" DataField="IsHold" AlreadyLocalized="False" ID="edIsHold" CommitChanges="True">
</px:PXCheckBox>
<px:PXTextEdit runat="server" DataField="Status" AlreadyLocalized="False" ID="edStatus" Enabled="False" CommitChanges="True" DefaultLocale="">
</px:PXTextEdit>
<px:PXDateTimeEdit runat="server" DataField="DateCreated" AlreadyLocalized="False" ID="edDateCreated" DefaultLocale="">
</px:PXDateTimeEdit>
<px:PXLayoutRule runat="server" ControlSize="XM" LabelsWidth="SM" StartColumn="True">
</px:PXLayoutRule>
<px:PXSelector ID="edLoanCD" runat="server" CommitChanges="True" DataField="LoanCD">
</px:PXSelector>
<px:PXTextEdit runat="server" DataField="CustomerName" AlreadyLocalized="False" ID="edCustomerName" CommitChanges="True" Enabled="False" DefaultLocale="">
</px:PXTextEdit>
<px:PXTextEdit runat="server" DataField="CustomerLocation" AlreadyLocalized="False" ID="edCustomerLocation" Enabled="False" CommitChanges="True" DefaultLocale="">
</px:PXTextEdit>
<px:PXSelector ID="edFinancingCompany" runat="server" DataField="FinancingCompany" Enabled="False">
</px:PXSelector>
<px:PXTextEdit runat="server" DataField="BranchCD" AlreadyLocalized="False" ID="edBranchCD" Enabled="False" DefaultLocale="">
</px:PXTextEdit>
<px:PXSelector ID="edReasonCode" runat="server" DataField="ReasonCode">
</px:PXSelector>
<px:PXTextEdit runat="server" DataField="Description" AlreadyLocalized="False" ID="edDescription" DefaultLocale="">
</px:PXTextEdit>
</Template>
</px:PXFormView>