C# 仅在选择器上显示活动的业务帐户
我只想在“Sales Quotes”(销售报价)屏幕上的业务帐户选择器中显示状态不为“Inactive”(非活动)的业务帐户。我一直在尝试使用Selector属性筛选所有业务帐户,但使用以下代码筛选非活动帐户:C# 仅在选择器上显示活动的业务帐户,c#,acumatica,acumatica-kb,C#,Acumatica,Acumatica Kb,我只想在“Sales Quotes”(销售报价)屏幕上的业务帐户选择器中显示状态不为“Inactive”(非活动)的业务帐户。我一直在尝试使用Selector属性筛选所有业务帐户,但使用以下代码筛选非活动帐户: [PXMergeAttributes(Method = MergeMethod.Replace)] [PXSelector(typeof(Select<BAccount, Where<BAccount.status, NotEqual<inactive>
[PXMergeAttributes(Method = MergeMethod.Replace)]
[PXSelector(typeof(Select<BAccount, Where<BAccount.status, NotEqual<inactive>>>))]
public int? BAccountID { get; set; }
public const string Inactive = "I";
public class inactive : PX.Data.BQL.BqlString.Constant<inactive>
{
public inactive() : base(Inactive) {; }
}
[pxmergattributes(Method=MergeMethod.Replace)]
[PXSelector(typeof(Select))]
公共整数?BAccountID{get;set;}
public const string Inactive=“I”;
公共类不活动:PX.Data.BQL.BqlString.Constant
{
公共非活动():基本(非活动){;}
}
但我一直在犯这样的错误:
任何帮助都将不胜感激报价DAC中的BAccountID字段将使用名为CustomerAndProspect的属性进行修饰。所以我所做的就是复制那个属性声明,添加了一个Where子句来排除非活动记录……就像这样
public class CustomBAccountSelector
{
[PXRestrictor(typeof(Where<BAccountR.type, Equal<BAccountType.prospectType>,
Or<BAccountR.type, Equal<BAccountType.customerType>,
Or<BAccountR.type, Equal<BAccountType.combinedType>,
And<Where<BAccountR.status,NotEqual<BAccountR.status.inactive>>>>>>), Messages.BAccountIsType, typeof(BAccountR.type))]
public class CustomerAndProspectAttributeExtension : BAccountAttribute
{
public CustomerAndProspectAttributeExtension()
: base()
{
this.Filterable = true;
this.DisplayName = "Customer";
}
}
}
公共类CustomBAccountSelector
{
[PXRestrictor(typeof(其中)、Messages.BAccountIsType、typeof(BAccountR.type))]
公共类CustomerAndProspectAttributeExtension:BAccountAttribute
{
公共CustomerAndProspectAttributeExtension()
:base()
{
this.Filterable=true;
this.DisplayName=“客户”;
}
}
}
接下来,我用新属性覆盖BaccountID声明
#region BAccountID
[PXMergeAttributes(Method = MergeMethod.Replace)]
[CustomerAndProspectAttributeExtension(DisplayName = "Business Account", BqlField = typeof(Standalone.CROpportunityRevision.bAccountID), Enabled = false)]
[PXDefault(typeof(Search<CROpportunity.bAccountID, Where<CROpportunity.opportunityID, Equal<Current<CRQuote.opportunityID>>>>), PersistingCheck = PXPersistingCheck.Nothing)]
#区域BAccountID
[PXMergeAttributes(Method=MergeMethod.Replace)]
[CustomerAndProspectAttributeExtension(DisplayName=“Business Account”,BqlField=typeof(Standalone.croportunityRevision.bAccountID),Enabled=false)]
[PXDefault(typeof(Search),PersistingCheck=PXPersistingCheck.Nothing)]
这对我来说不起作用,但最终起作用的是为字段的缓存附加事件处理程序添加一个限制符。