如何向现有Acumatica页面添加额外过滤器
你好 每个供应商和客户都将与负责他们的员工联系起来 我需要在“计算过期费用”页面上添加一个额外的过滤器,AR507000,这将链接回客户,只显示员工 当前添加代码以添加此额外筛选器的位置是什么? 有没有人有我可以找到更多信息的例子或文章如何向现有Acumatica页面添加额外过滤器,acumatica,Acumatica,你好 每个供应商和客户都将与负责他们的员工联系起来 我需要在“计算过期费用”页面上添加一个额外的过滤器,AR507000,这将链接回客户,只显示员工 当前添加代码以添加此额外筛选器的位置是什么? 有没有人有我可以找到更多信息的例子或文章 我确实找到了方法,但我不确定这是否是最好的方法。首先,找到进行计算/筛选的方法。在我的情况下,它是CalculateFinancialCharges 2de在普通baseMethod下添加您的逻辑,并使用remove(item)删除所需的项 public委托v
我确实找到了方法,但我不确定这是否是最好的方法。首先,找到进行计算/筛选的方法。在我的情况下,它是CalculateFinancialCharges 2de在普通baseMethod下添加您的逻辑,并使用remove(item)删除所需的项
public委托void calculatefinancechargesdelegate(ARFinChargesApplyParameters过滤器);
[PXOverride]
公共无效CalculateFinancialCharges(ArFinChargesApply参数筛选器,CalculateFincialChargesdLegate baseMethod)
{
基本方法(过滤器);
尝试
{
ARFinChargesApplyParameters curARFinChargesApplyParameters=this.Base.Filter.Current;
ARFinChargesApplyParametersExt curARFinChargesApplyParametersExt=curARFinChargesApplyParameters.GetExtension();
if(!string.IsNullOrWhiteSpace(curARFinChargesApplyParametersExt.usRemployeId))
{
foreach(此.Base.ARFinChargeRecords.Cache.Inserted中的ARFinChargesDetails项)
{
BAccount BAccount=PXSelect。
选择(基本、项目、客户ID);
BAccountExt BAccountExt=bAccount.GetExtension();
if(bAccountExt.UsrEmployeeID!=curARFinChargesApplyParametersExt.UsrEmployeeID)
{
this.Base.ARFinChargeRecords.Cache.Remove(项);
}
}
}
}
捕获(例外情况除外)
{
PXTrace.WriteError(ex);
}
}
public delegate void CalculateFinancialChargesDelegate(ARFinChargesApplyParameters filter);
[PXOverride]
public void CalculateFinancialCharges(ARFinChargesApplyParameters filter, CalculateFinancialChargesDelegate baseMethod)
{
baseMethod(filter);
try
{
ARFinChargesApplyParameters curARFinChargesApplyParameters = this.Base.Filter.Current;
ARFinChargesApplyParametersExt curARFinChargesApplyParametersExt = curARFinChargesApplyParameters.GetExtension<ARFinChargesApplyParametersExt>();
if (!string.IsNullOrWhiteSpace(curARFinChargesApplyParametersExt.UsrEmployeeID))
{
foreach (ARFinChargesDetails item in this.Base.ARFinChargeRecords.Cache.Inserted)
{
BAccount bAccount = PXSelect<Customer,
Where<Customer.bAccountID, Equal<Required<ARFinChargesDetails.customerID>>>>.
Select(Base, item.CustomerID);
BAccountExt bAccountExt = bAccount.GetExtension<BAccountExt>();
if (bAccountExt.UsrEmployeeID != curARFinChargesApplyParametersExt.UsrEmployeeID)
{
this.Base.ARFinChargeRecords.Cache.Remove(item);
}
}
}
}
catch (Exception ex)
{
PXTrace.WriteError(ex);
}
}