Acumatica 如何使用限流器

Acumatica 如何使用限流器,acumatica,Acumatica,我一直在玩这个PX限制器,我有点不知道如何在当前图表上的一个不相关的表上使用它。所以在销售订单中,我想限制查找屏幕上的项目。我希望我在ARSalesPrice表中添加的项目不会出现在查找屏幕中。我覆盖了SOline InventoryID的属性,如下所示 [SOLineInventoryItem(Filterable=true)] [PXDefault()] [PXRestrictor(typeof(Where<ARSalesPrice.inventoryID,Equal<Inven

我一直在玩这个PX限制器,我有点不知道如何在当前图表上的一个不相关的表上使用它。所以在销售订单中,我想限制查找屏幕上的项目。我希望我在ARSalesPrice表中添加的项目不会出现在查找屏幕中。我覆盖了SOline InventoryID的属性,如下所示

[SOLineInventoryItem(Filterable=true)]
[PXDefault()]
[PXRestrictor(typeof(Where<ARSalesPrice.inventoryID,Equal<InventoryItem.inventoryID>>), "RESTRICTION ACTIVATED !!!")]
protected virtual void SOLine_InventoryID_CacheAttached(PXCache cache)
{

}
[SOLineInventoryItem(Filterable=true)]
[PXDefault()]
[PX限流器(类型)(其中

我尝试了Equal和NotEqual条件,但我认为问题在于ARSalesPrice不在图表中。我做错了什么


TIA

您只能使用在同一字段的选择器中使用dac的限制器。在您的示例中,很可能
ArsalePrice
不在
SOLine.InventoryID
的选择器中,因此您无法通过此dac进行限制

实际上,您可以在
SOLineInventoryItemAttribute
的属性中看到两个PXRestrictor在使用:

[PXDBInt()]
[PXUIField(DisplayName = "Inventory ID", Visibility = PXUIVisibility.Visible)]
[PXRestrictor(typeof(Where<InventoryItem.itemStatus, NotEqual<InventoryItemStatus.noSales>>), IN.Messages.ItemCannotSale)]
[PXRestrictor(typeof(Where<InventoryItem.itemStatus, NotEqual<InventoryItemStatus.unknown>>), PM.Messages.ReservedForProject)]
public class SOLineInventoryItemAttribute : CrossItemAttribute
{
//...
}

您可以为不同的条件应用多个限制器。在这里您可以看到带有附加限制器的PXSelector语句。

您只能使用一个限制器,该限制器在同一字段的选择器中使用DAC。在您的示例中,最有可能的是
ARSalesPrice
不在
SOLine.InventoryID
上的选择器中因此,您不能受此dac的限制

实际上,您可以在
SOLineInventoryItemAttribute
的属性中看到两个PXRestrictor在使用:

[PXDBInt()]
[PXUIField(DisplayName = "Inventory ID", Visibility = PXUIVisibility.Visible)]
[PXRestrictor(typeof(Where<InventoryItem.itemStatus, NotEqual<InventoryItemStatus.noSales>>), IN.Messages.ItemCannotSale)]
[PXRestrictor(typeof(Where<InventoryItem.itemStatus, NotEqual<InventoryItemStatus.unknown>>), PM.Messages.ReservedForProject)]
public class SOLineInventoryItemAttribute : CrossItemAttribute
{
//...
}

您可以为不同的条件应用多个限制符。在这里,您可以看到带有附加限制符的PXSelector语句。

您的错误是在查询的select部分中没有ARSALEPRICE表,不能在where条件中使用它。您的错误是在select部分中没有ARSALEPRICE表查询的一部分,您不能在where条件下使用它。