在系统中找不到Smartpanel中显示错误'<选择器名称=“”>的选择器。

时间:2018-07-09 13:35:41

标签: acumatica

我有一个带有两个不同选择器的智能面板,这些选择器的数据字段分别称为KnownContributor和NewContributor。当我从任一选择器(例如NewContributor)中选择一个选择时,选择器突出显示为红色,并且出现错误消息“在系统中找不到NewContributor”。我已经清楚地定义了选择器,并且该页面存在于多个智能面板的页面中,这些面板以相同的精确方式定义,并且选择器也以除PXSelector的Search语法以外的完全相同的方式定义。

以下是进行选择之前和之后的图像: enter image description here

enter image description here

这是所有代码:

ASPX:

<px:PXSmartPanel AutoReload="false" runat="server" DesignView="content" Height="225px" Width ="350px" ID="spSetOnlineCheck" LoadOnDemand="true" AutoRepaint="true" ShowAfterLoad="true" CaptionVisible="true" Caption="Set Online Check Contributor" Key="SetOnlineCheckPopup">
    <px:PXFormView Height="225px" Width="100%" SkinID="Transparent" DataSourceID="ds" runat="server" ID="fvOnlineCheck" DataMember="SetOnlineCheckPopup">
        <Template>
            <px:PXLayoutRule runat="server" ID="lrPopupCheck" StartColumn="True"></px:PXLayoutRule>
            <px:PXPanel Width="100%" Height="200px" runat="server" ID="pnlOnlineCheck">
                <px:PXLabel Width="100%" Height="50px" runat="server" ID="lblOnlineCheck" Text="Pick contributor to be associated with this online check."></px:PXLabel>
                <px:PXSelector FilterByAllFields="true" CommitChanges="True" runat="server" ID="selKnown" DataField="KnownContributor"></px:PXSelector>
<px:PXLabel runat="server" ID="CstLabel9" Size="10px" ></px:PXLabel>
<px:PXSelector CommitChanges="True" runat="server" ID="CstPXSelector10" DataField="NewContributor" ></px:PXSelector>
                <px:PXLabel runat="server"  ID="lblOnlineBankSpace" Height="50px"></px:PXLabel>
                <px:PXButton runat="server" ID="AddContributorOK" Text="OK" DialogResult="OK"></px:PXButton>
            <px:PXButton runat="server" ID="AddContributorCancel" Text="Cancel" DialogResult="Cancel"></px:PXButton></px:PXPanel>
        </Template>
    </px:PXFormView>
</px:PXSmartPanel>

DAC:

[Serializable]
public class SetBankCheckPopup : IBqlTable
{
    [PXInt()]
    [PXUIField(DisplayName = "BankID")]
    public int? BankID { get; set; }
    public class bankdID : IBqlField { }

    [PXInt()]
    [PXUIField(DisplayName = "Known Contributors")]
    [PXSelector(typeof(Search<CustomerPaymentMethod.bAccountID>),
        new Type[]{
            typeof(CustomerPaymentMethod.bAccountID)
        })]
    //[PXSelector(typeof(Search5<CustomerPaymentMethod.bAccountID, InnerJoin<CustomerPaymentMethodDetail,
    //    On<CustomerPaymentMethod.pMInstanceID, Equal<CustomerPaymentMethodDetail.pMInstanceID>,
    //        And<CustomerPaymentMethodDetail.detailID, Equal<C1>,
    //    And<CustomerPaymentMethodDetail.value, Equal<Current<SetBankCheckPopup.routeNbr>>>>>,
    //    InnerJoin<CFBSCustomerPaymentMethodDetailCopy, On<CFBSCustomerPaymentMethodDetailCopy.pMInstanceID, Equal<CustomerPaymentMethod.pMInstanceID>,
    //       And<CFBSCustomerPaymentMethodDetailCopy.detailID, Equal<C2>,
    //        And<CFBSCustomerPaymentMethodDetailCopy.value, Equal<Current<SetBankCheckPopup.acctNbr>>>>>,
    //        InnerJoin<BAccount, On<BAccount.bAccountID, Equal<CustomerPaymentMethod.bAccountID>>>>>, Aggregate<GroupBy<CustomerPaymentMethod.bAccountID>>>),
    //    new Type[]
    //    {
    //        typeof(BAccount.acctCD),
    //        typeof(BAccount.acctName)
    //    },
    //    ValidateValue =false
    //    )]
    public int? KnownContributor { get; set; }
    public class knownContributor : IBqlField { }

    [PXInt()]
    [PXUIField(DisplayName = "New Contributor")]
    //[PXSelector(typeof(Search<CustomerPaymentMethod.bAccountID>),
    //    new Type[]{
    //        typeof(CustomerPaymentMethod.bAccountID)
    //    })]
    [PXSelector(typeof(Search5<CustomerPaymentMethod.bAccountID, InnerJoin<CustomerPaymentMethodDetail,
        On<CustomerPaymentMethod.pMInstanceID, Equal<CustomerPaymentMethodDetail.pMInstanceID>,
            And<CustomerPaymentMethodDetail.detailID, Equal<C1>,
        And<CustomerPaymentMethodDetail.value, NotEqual<Current<SetBankCheckPopup.routeNbr>>>>>,
        InnerJoin<CFBSCustomerPaymentMethodDetailCopy, On<CFBSCustomerPaymentMethodDetailCopy.pMInstanceID, Equal<CustomerPaymentMethod.pMInstanceID>,
           And<CFBSCustomerPaymentMethodDetailCopy.detailID, Equal<C2>,
            And<CFBSCustomerPaymentMethodDetailCopy.value, NotEqual<Current<SetBankCheckPopup.acctNbr>>>>>,
            InnerJoin<BAccount, On<BAccount.bAccountID, Equal<CustomerPaymentMethod.bAccountID>>>>>, Aggregate<GroupBy<CustomerPaymentMethod.bAccountID>>>),
                    new Type[]
        {
            typeof(CustomerPaymentMethod.bAccountID),
            typeof(BAccount.acctName)
        },
        DescriptionField = typeof(BAccount.acctName),
        SubstituteKey = typeof(BAccount.bAccountID),
        ValidateValue = false
        )]
    public int? NewContributor { get; set; }
    public class newContributor : IBqlField { }

    [PXString()]
    [PXUIField(DisplayName = "Route Nbr")]
    public string RouteNbr { get; set; }
    public class routeNbr : IBqlField { }

    [PXString()]
    [PXUIField(DisplayName = "Acct Nbr")]
    public string AcctNbr { get; set; }
    public class acctNbr : IBqlField { }
}

操作按钮:

public PXAction<CFBSContributionDetail> SetOnlineCheck;
[PXButton(CommitChanges = true)]
[PXUIField(DisplayName = "Set Online Check")]
protected void setOnlineCheck()
{
    //NOTE: All online checks come in under the same bank number and routing number. There is no way to distinguish who's check it is without looking at the check.
    SetOnlineCheckPopup.Current.RouteNbr = CurrentDocument.Current.RouteNbr;
    SetOnlineCheckPopup.Current.AcctNbr = CurrentDocument.Current.AcctNbr;

    if (SetOnlineCheckPopup.AskExt() == WebDialogResult.OK)
    {
        if (SetOnlineCheckPopup.Current.KnownContributor == null && SetOnlineCheckPopup.Current.NewContributor == null)
            return;
        CFBSContributionDetail row = CurrentDocument.Current;

        //Create payment record for customer with bank and routing number
        if (SetOnlineCheckPopup.Current.KnownContributor == null)
        {
            CreateNewCustomerPaymentMethod(row, SetOnlineCheckPopup.Current.NewContributor);
            row.ContributorID = SetOnlineCheckPopup.Current.NewContributor;
        }
        else
        {
            row.ContributorID = SetOnlineCheckPopup.Current.KnownContributor;
        }

    }
}

注意:在DAC中,我刚好包含了所有cusotmers,而在第二个DAC中,我保留了我想要的原始过滤器。我这样做只是为了证明不是引起此问题的PXSelector(Search)部分。

1 个答案:

答案 0 :(得分:0)

我发现这是因为选择器基于CustomerPaymentMethod。我将其切换为基于BAccount([PXSelector(typeof