如何为现成的销售订单实体添加属性支持? [英] How to add Attribute Support to out-of-box Sales Order Entity?
问题描述
现成的 Acumatica销售订单(SO301000)
不具有属性支持。如何将属性支持扩展到Acumatica中的销售订单实体?
Out-of-box Acumatica Sales Order (SO301000)
does not have attribute support. How to extend attribute support to Sales Order entity in Acumatica?
推荐答案
从根本上讲,您的实体主DAC必须具有GUID列( NoteID
)引用 CSAnswers
表,并且必须具有标识实体类的字段。
At the very core, your entity main DAC must have GUID column (NoteID
) to reference CSAnswers
table and must have field that identify the class of the Entity.
我们将使用订单类型
定义属性列表,以收集特定于订单类型的特定信息。
We will make use of Order Type
to define list of attributes to gather particular order type-specific information.
为 SOOrderTypeMaint
图形创建图形扩展,并声明数据视图以定义特定订单类型的属性列表。我们将使用现成的 CSAttributeGroupList< TEntityClass,TEntity>
Create a Graph Extension for SOOrderTypeMaint
Graph and declare data view to define list of attributes for a particular order type. We will be using out-of-box CSAttributeGroupList<TEntityClass, TEntity>
public class SOOrderTypeMaintPXExt : PXGraphExtension<SOOrderTypeMaint>
{
[PXViewName(PX.Objects.CR.Messages.Attributes)]
public CSAttributeGroupList<SOOrderType, SOOrder> Mapping;
}
为 SOOrderEntry $ c创建图扩展$ c>为特定于当前订单类型的属性绘制图形并声明数据视图。
Create a Graph Extension for SOOrderEntry
Graph and declare data view for attributes specific to current order type.
public class SOOrderEntryPXExt : PXGraphExtension<SOOrderEntry>
{
public CRAttributeList<SOOrder> Answers;
}
为 SOOrder $ c $创建DAC扩展c> DAC并声明用
CRAttributesField
属性修饰的用户定义字段,并指定 ClassID
字段–在我们的示例中为 OrderType
。
Create DAC Extension for SOOrder
DAC and declare user defined field decorated with CRAttributesField
attribute and specify the ClassID
field – in our case it is OrderType
.
public class SOOrderPXExt : PXCacheExtension<SOOrder>
{
#region UsrAttributes
public abstract class usrAttributes : IBqlField { }
[CRAttributesField(typeof(SOOrder.orderType))]
public virtual string[] UsrAttributes { get; set; }
#endregion
}
修改订单类型页面( SO201000
),如下所示使用定制引擎
Modify Order Types page (SO201000
) as below using Customization Engine
<px:PXTabItem Text = "Attributes" >
<Template>
<px:PXGrid runat = "server" BorderWidth="0px" Height="150px" SkinID="Details" Width="100%" ID="AttributesGrid"
MatrixMode="True" DataSourceID="ds">
<AutoSize Enabled = "True" Container="Window" MinHeight="150" />
<Levels>
<px:PXGridLevel DataMember = "Mapping" >
<RowTemplate>
<px:PXSelector runat = "server" DataField="AttributeID" FilterByAllFields="True" AllowEdit="True"
CommitChanges="True" ID="edAttributeID" /></RowTemplate>
<Columns>
<px:PXGridColumn DataField = "AttributeID" Width="81px" AutoCallBack="True" LinkCommand="ShowDetails" />
<px:PXGridColumn DataField = "Description" Width="351px" AllowNull="False" />
<px:PXGridColumn DataField = "SortOrder" TextAlign="Right" Width="81px" />
<px:PXGridColumn DataField = "Required" Type="CheckBox" TextAlign="Center" AllowNull="False" />
<px:PXGridColumn DataField = "CSAttribute__IsInternal" Type="CheckBox" TextAlign="Center" AllowNull="True" />
<px:PXGridColumn DataField = "ControlType" Type="DropDownList" Width="81px" AllowNull="False" />
<px:PXGridColumn DataField = "DefaultValue" RenderEditorText="False" Width="100px" AllowNull="True" />
</Columns>
</px:PXGridLevel>
</Levels>
</px:PXGrid>
</Template>
</px:PXTabItem>
修改销售订单页面( SO301000
)为下面使用定制引擎
Modify Sales Orders page (SO301000
) as below using Customization Engine
<px:PXTabItem Text="Attributes">
<Template>
<px:PXGrid runat="server" ID="PXGridAnswers" Height="200px" SkinID="Inquire"
Width="100%" MatrixMode="True" DataSourceID="ds">
<AutoSize Enabled="True" MinHeight="200" />
<ActionBar>
<Actions>
<Search Enabled="False" />
</Actions>
</ActionBar>
<Mode AllowAddNew="False" AllowDelete="False" AllowColMoving="False" />
<Levels>
<px:PXGridLevel DataMember="Answers">
<Columns>
<px:PXGridColumn TextAlign="Left" DataField="AttributeID" TextField="AttributeID_description"
Width="250px" AllowShowHide="False" />
<px:PXGridColumn Type="CheckBox" TextAlign="Center" DataField="isRequired" Width="80px" />
<px:PXGridColumn DataField="Value" Width="300px" AllowSort="False" AllowShowHide="False" />
</Columns>
</px:PXGridLevel>
</Levels>
</px:PXGrid>
</Template>
</px:PXTabItem>
这篇关于如何为现成的销售订单实体添加属性支持?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!