Reputation: 30
I want to know the best way to append the DAC attributes..Please note I need Appending method for DAC Attributes not DAC Field Attributes. Specifically I need to append [PXEMailSource] to some of the existing DACs Eg: PX.Objects.IN.INRegister What is the best way to do it ...? Any helps regarding this will be highly appreciated
Upvotes: 1
Views: 362
Reputation: 7706
You can change the attribute of the DAC using PXSubstituteAttribute
Note from Acumatica Framework Development Guide(page 95)
PXSubstitute Attribute
Indicates that the derived DAC should replace its base DACs in a specific graph or all graphs.• public Type GraphType
Gets or sets the specific graph in which the derived DAC replaces base DACs.
• public Type ParentType
Gets or sets the base DAC type up to which all types in the inheritance hierarchy are substituted with the derived DAC. By default, the property has the null value, which means that all base DACs are substituted with the derived DACRemarks
The attribute is placed on the definition of a DAC that is derived from another DAC. The attribute is used primarily to make the declarative references of the base DAC in definitions of calculations and links from child objects to parent objects be interpreted as the references of the derived DAC.
Below is the example how to use Attribute
on INRegister
DAC.
[PXPrimaryGraph(new Type[]
{
typeof(INReceiptEntry),
typeof(INIssueEntry),
typeof(INTransferEntry),
typeof(INAdjustmentEntry),
typeof(KitAssemblyEntry),
typeof(KitAssemblyEntry)
}, new Type[]
{
typeof(Where<INRegister.docType, Equal<INDocType.receipt>>),
typeof(Where<INRegister.docType, Equal<INDocType.issue>>),
typeof(Where<INRegister.docType, Equal<INDocType.transfer>>),
typeof(Where<INRegister.docType, Equal<INDocType.adjustment>>),
typeof(Select<INKitRegister, Where<INKitRegister.docType, Equal<INDocType.production>, And<INKitRegister.refNbr, Equal<Current<INRegister.refNbr>>>>>),
typeof(Select<INKitRegister, Where<INKitRegister.docType, Equal<INDocType.disassembly>, And<INKitRegister.refNbr, Equal<Current<INRegister.refNbr>>>>>)
})]
[INRegisterCacheName("Receipt")]
[Serializable]
[PXSubstitute(GraphType = typeof(REQUIREDGRAPH_WHERE_SHOULD_BE_SUBSTITED))]
[PXEMailSource]
public class INRegisterExt: INRegister
{
//...
}
Upvotes: 1