Specifically we are trying to customize the Attributes screen to add an Attribute Type/Category field (combobox). Then we can categorise attributes by Customer, Item, Other etc.
I have created the custom field (usrAttributeType) as a PXDBString with PXStringList for the combo values.
I have modified the PXSelector for the Attribute ID field. We want to have the Selector for the AttributeID use the value from the custom field to limit the attributes to ones with the category selected instead of the constant it uses currently.
The field is called usrAttributeType and I have added the following so far:
namespace PX.Objects.CS
{
public class CSAttributeMaint_Extension : PXGraphExtension<CSAttributeMaint>
{
#region Event Handlers
public class attribType: PX.Data.Constant<string> {
public attribType() : base("I") { }
}
[PXDBString(10, IsUnicode = true, IsKey = true, InputMask = ">aaaaaaaaaa")]
[PXDefault()]
[PXUIField(DisplayName = "Attribute ID", Visibility = PXUIVisibility.SelectorVisible)]
[PXSelector(typeof(Search<CSAttribute.attributeID,
Where<
CSAttribute.attributeID, NotEqual<MatrixAttributeSelectorAttribute.dummyAttributeName>
,
And<
CSAttributeExt.usrAttributeType, Equal<attribType>
>>
>))]
protected virtual void CSAttribute_AttributeID_CacheAttached(PXCache cache)
{
}
#endregion
}
}
I’m not sure how to refer to the custom field and get the value it’s set to.
Any help would be much appreciated.
Thanks,
Phil
Best answer by Marco Villasenor
View original