Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/ruby-on-rails-4/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Acumatica 在库存查找中添加属性字段_Acumatica - Fatal编程技术网

Acumatica 在库存查找中添加属性字段

Acumatica 在库存查找中添加属性字段,acumatica,Acumatica,我想为销售订单和采购订单上的库存查找添加属性,有人知道如何添加吗?或者有什么想法?请参考下面的代码示例,利用现成的CRAttributesFieldAttribute在选择器和网格控件中包含属性列 声明从CRAttributesFieldAttribute继承的类pxaddAttributeColumns 公共类pxaddAttributeColumns:CRAttributesFieldAttribute { 字符串[]_名称; 布尔伊斯福勒选民; 公共PXAddAtttributeColum

我想为销售订单和采购订单上的库存查找添加属性,有人知道如何添加吗?或者有什么想法?

请参考下面的代码示例,利用现成的
CRAttributesFieldAttribute在选择器和网格控件中包含属性列

声明从
CRAttributesFieldAttribute
继承的类pxaddAttributeColumns

公共类pxaddAttributeColumns:CRAttributesFieldAttribute
{
字符串[]_名称;
布尔伊斯福勒选民;
公共PXAddAtttributeColumns(字符串[]名称,类型entityType,类型entityIDField,类型classIDField,bool IsForSelector=true)
:基本(entityType、entityIDField、classIDField)
{
_姓名=姓名;
_IsForSelector=IsForSelector;
}
公共覆盖无效缓存已附加(PXCache发送方)
{
这是真的;
基缓存已附加(发送方);
}
受保护的覆盖无效AttributeFieldSelecting(PXCache发送方、PXFieldSelectingEventArgs e、PXFieldState状态、字符串attributeName、int idx)
{
if(_names.Any(attributeName.Equals))
{
//开箱即用的DisplayName前缀为“$Attributes$-”-如果您需要去掉它。
state.DisplayName=(!String.IsNullOrEmpty(state.DisplayName))?(state.DisplayName.Replace(“$Attributes$-”,“”)):attributeName;
state.Visible=true;
//需要PXGrid控件的AutoGenerateColumns=“AppendDynamic”来创建动态属性列
state.Visibility=(_IsForSelector)?PXUIVisibility.selector可见:PXUIVisibility.Dynamic;
}
base.AttributeFieldSelecting(发送方、e、状态、attributeName、idx);
}
公共覆盖无效命令准备(PXCache发送方,PXCommandPreparingEventArgs e)
{
基本命令(发送方,e);
if(e.BqlTable==null&&aggregateAttributes&&sender.GetItemType().IsDefined(typeof(PXProjectionAttribute),true))
{
e、 BqlTable=_BqlTable;
}
}
}
要将属性作为列包含在清单查找中,请声明DAC扩展,如下所示:

公共类InventoryItemPXExt:PXCacheExtension
{
#区域属性
公共抽象类属性:IBqlField{}
[pxaddattributecolumns(新[]{“ASSETID”,“HWMODEL”},
类型(CSAnswerType.inventoryAnswerType),
类型(InventoryItem.inventoryID),
类型(InventoryItem.itemClassID))]
公共虚拟字符串[]属性{get;set;}
#端区
}
字段将显示如下:

通过将
FilterByAllFields
设置为
True

要将属性作为列包含在销售订单详细信息网格中,请声明DAC扩展,如下所示:

公共类SOLineExtension:PXCacheExtension
{
公共抽象类itemtattributes:IBqlField{}
[pxaddattributecolumns(新[]{“ASSETID”,“HWMODEL”},
类型(CSAnswerType.inventoryAnswerType),
类型(SOLine.inventoryID),
typeof(InventoryItem.itemClassID),false)]
公共虚拟字符串[]ItemAttributes{get;set;}
}
确保为
PXGrid
控制动态属性列创建指定
AutoGenerateColumns=“AppendDynamic”

字段将显示如下:

要将属性作为列包含在“添加库存项目”对话框的网格中,请声明DAC扩展,如下所示:

公共类SOSiteStatusSelectedExtension:PXCacheExtension
{
公共抽象类itemtattributes:IBqlField{}
[pxaddattributecolumns(新[]{“ASSETID”,“HWMODEL”},
类型(CSAnswerType.inventoryAnswerType),
类型(InventoryItem.inventoryID),
typeof(InventoryItem.itemClassID),false)]
公共虚拟字符串[]ItemAttributes{get;set;}
}
确保为
PXGrid
控制动态属性列创建指定
AutoGenerateColumns=“AppendDynamic”

字段将显示如下:


注:此示例适用于5.3系列–构建5.30.1367之后的版本。

请参考下面的代码示例,以使用开箱即用的
CRAttributesFieldAttribute在选择器和网格控件中包括属性列

声明从
CRAttributesFieldAttribute
继承的类pxaddAttributeColumns

公共类pxaddAttributeColumns:CRAttributesFieldAttribute
{
字符串[]_名称;
布尔伊斯福勒选民;
公共PXAddAtttributeColumns(字符串[]名称,类型entityType,类型entityIDField,类型classIDField,bool IsForSelector=true)
:基本(entityType、entityIDField、classIDField)
{
_姓名=姓名;
_IsForSelector=IsForSelector;
}
公共覆盖无效缓存已附加(PXCache发送方)
{
这是真的;
基缓存已附加(发送方);
}
受保护的覆盖无效AttributeFieldSelecting(PXCache发送方、PXFieldSelectingEventArgs e、PXFieldState状态、字符串attributeName、int idx)
{
if(_names.Any(attributeName.Equals))
{
//开箱即用的DisplayName前缀为“$Attributes$-”-如果您需要去掉它。
state.DisplayName=(!String.IsNullOrEmpty(state.DisplayName))?(state.DisplayName.Replace(“$Attributes$-”,“”)):attributeName;
state.Visible=true;
//需要PXGrid控件的AutoGenerateColumns=“AppendDynamic”来创建动态属性列
state.Visibility=(_IsForSelector)?PXUIVisibility.selector可见:PXUIVisibility.Dynamic;
}
base.AttributeFieldSelecting(发送方、e、状态、attributeName、idx);
}
公共覆盖无效命令准备(PXCache发送方,PXCommandPreparingEventArgs e)