基于Acumatica中基于联系人选择的客户查找

问题描述 投票:0回答:1

我需要在SO屏幕(SO301000)中创建客户查找。我已经如下创建了用户定义的自定义字段。

#region UsrKWBSCustomerID
        [CustomerAndProspect(Filterable = true, DirtyRead = true)]
        [PXUIField(DisplayName = "Customer")]
        //[PXRestrictor(typeof(Where<BAccountR.status, NotEqual<BAccountR.status.inactive>,// Or<BAccountR.type, Equal<BAccountType.customerType>, Or<BAccountR.type, Equal<BAccountType.combinedType>>>,
        //            And<Where<Contact.contactID, Equal<Current<SOOrderExt.usrKWContactID>>,
        //                    Or<Current<SOOrderExt.usrKWContactID>, IsNull>>>>), PX.Objects.CR.Messages.ContactBAccountDiff)]
        //[PXDefault(typeof(Where<BAccountR.status, NotEqual<BAccountR.status.inactive>,// Or<BAccountR.type, Equal<BAccountType.customerType>, Or<BAccountR.type, Equal<BAccountType.combinedType>>>,
        //            And<Where<Contact.contactID, Equal<Current<SOOrderExt.usrKWContactID>>,
        //                    Or<Current<SOOrderExt.usrKWContactID>, IsNull>>>>),PersistingCheck = PXPersistingCheck.Nothing)]
        ////[PXFormula(typeof(Default<Contact.bAccountID>))]
        ////[PXRestrictor(typeof(Where<Contact.isActive, Equal<True>>), PX.Objects.CR.Messages.ContactInactive,
        ////                  typeof(Contact.displayName))]
        //[PXRestrictor(typeof(Where<BAccountR.type, Equal<BAccountType.prospectType>, Or<BAccountR.type, Equal<BAccountType.customerType>, Or<BAccountR.type, Equal<BAccountType.combinedType>>>>), "Business Account is {0}.", new[] { typeof(BAccountR.type) })]
        //[PXSelector(typeof(Search<Customer.bAccountID>), new Type[] { typeof(Customer.acctCD), typeof(Customer.acctName), typeof(Customer.status), typeof(Customer.classID) }, 
        //    SubstituteKey = typeof(Customer.acctName), DescriptionField = typeof(Customer.acctName))]
        public virtual int? UsrKWBSCustomerID { get; set; }
        public abstract class usrKWBSCustomerID : PX.Data.BQL.BqlInt.Field<usrKWBSCustomerID> { }
        #endregion

我也尝试过以下一项,但没有用v =某人可以纠正我做错的地方,我期望的输出是当用户选择联系人时,相应的客户应自动加载到我的自定义字段中,如商机屏幕的工作方式>]

#region UsrKWBSCustomerID
        //[CustomerAndProspect(Filterable = true, DirtyRead = true)]
        [PXDBInt()]
        [PXUIField(DisplayName = "Customer")]
        [PXSelector(typeof(Search2<BAccount2.bAccountID,
                LeftJoin<Contact, On<Contact.bAccountID, Equal<BAccount2.bAccountID>>>, Where<BAccount2.type, Equal<BAccountType.prospectType>, Or<BAccount2.type, Equal<BAccountType.customerType>, Or<BAccount2.type, Equal<BAccountType.combinedType>>>>>),
                DescriptionField = typeof(BAccount2.acctName), Filterable = true, DirtyRead = true)]
        [PXDefault(PersistingCheck = PXPersistingCheck.Nothing)]
        [PXFormula(typeof(Default<Contact.bAccountID>))]
        [PXRestrictor(typeof(Where2<Where<BAccount2.type, Equal<BAccountType.prospectType>, Or<BAccount2.type, Equal<BAccountType.customerType>, Or<BAccount2.type, Equal<BAccountType.combinedType>>>>,
                    And<Where<Contact.contactID, Equal<Current<SOOrderExt.usrKWContactID>>,
                            Or<Current<SOOrderExt.usrKWContactID>, IsNull>>>>), PX.Objects.CR.Messages.ContactBAccountDiff)]
        [PXRestrictor(typeof(Where<BAccount2.status, Equal<BAccount2.status.inactive>>), "Customer '{0}' is inactive",
                          typeof(BAccount2.acctName))]
 public virtual int? UsrKWBSCustomerID { get; set; }
        public abstract class usrKWBSCustomerID : PX.Data.BQL.BqlInt.Field<usrKWBSCustomerID> { }
        #endregion

我需要在SO屏幕(SO301000)中创建客户查找。我已经如下创建了用户定义的自定义字段。 #region UsrKWBSCustomerID [CustomerAndProspect(Filterable = true,...

acumatica acumatica-kb
1个回答
0
投票

销售订单DAC已经具有使用DAC BAccountR的客户选择器。在同一BAccountR DAC上创建另一个选择器会产生冲突,因为只能有一个当前的DAC对象。

© www.soinside.com 2019 - 2024. All rights reserved.