Страница: AR303000 Мне нужно изменить свой оператор BQL с где на 2.Моя конечная цель состоит в том, чтобы, если для customerClassID было 02 или 03, поле «Внимание» стало обязательным
Ниже указано «Где2», которое необходимо исправить:
[PXUIRequired(typeof(Where2<Where
<Customer.customerClassID, Equal<attentionRequiredCustomerClass02>>, Or<Customer.customerClassID, Equal<attentionRequiredCustomerClass03>>>))]
Это фрагмент кода:
//create constant class to check the CustomerClassID that is a string
public const string AttentionRequiredCustomerClass02 = "02";
public class attentionRequiredCustomerClass02 : PX.Data.BQL.BqlString.Constant<attentionRequiredCustomerClass02>
{
public attentionRequiredCustomerClass02() : base(AttentionRequiredCustomerClass02) {; }
}
//create constant class to check the CustomerClassID that is a string
public const string AttentionRequiredCustomerClass03 = "03";
public class attentionRequiredCustomerClass03 : PX.Data.BQL.BqlString.Constant<attentionRequiredCustomerClass03>
{
public attentionRequiredCustomerClass03() : base(AttentionRequiredCustomerClass03) {; }
}
//Contact.Attention
//merge the attribute with the existing, setting the making Attention required when CustomerClassID = 2
[PXMergeAttributes(Method = MergeMethod.Merge)]
[PXDefault(PersistingCheck = PXPersistingCheck.Nothing)]
//selector follows the contact's baccount to get the customer class, and compares it to the bql constant created above.
//[PXUIRequired(typeof(Where2<Where<Customer.customerClassID, Equal<attentionRequiredCustomerClass02>>, Or<Customer.customerClassID, Equal<attentionRequiredCustomerClass03>>>))]
[PXUIRequired(typeof(Where<Selector <Contact.bAccountID,Customer.customerClassID>, Equal<attentionRequiredCustomerClass02>>))]
protected virtual void Contact_Attention_CacheAttached(PXCache cache)
{ }
[PXUIRequired], который не закомментирован, работает, мне нужно включить вниманиеRequiredCustomerClass03 в мое утверждение.
Моя конечная цель заключается в том, что если customerClassID равен 02 или 03, то Вниманиеполе становится обязательным