select ValueID from CSAttributeDetail where AttributeID = 'MFGPRPALLE';
I need to get same result like above sql query. How can I get the result using PXSelector?
select ValueID from CSAttributeDetail where AttributeID = 'MFGPRPALLE';
I need to get same result like above sql query. How can I get the result using PXSelector?
Best answer by vardan22
To be able to use the constant string value in the PXSelector attribute you need to create the constant Bql class:
public class AttributeConstants
{
public const string AttributeConstID = "MFGPRPALLE";
public class attributeConstID : BqlType<IBqlString,string>.Constant<attributeConstID>
{
public attributeConstID() : base(AttributeConstID) { }
}
}
After that, you can declare the field and put the PXSelector like the following:
public sealed class SOOrderExt : PXCacheExtension<SOOrder>
{
public static bool IsActive() => true;
#region UsrFakeField
[PXDBString(10)]
[PXUIField(DisplayName = "MFGPRPALLE")]
[PXSelector(typeof(Search<CSAttributeDetail.valueID,Where<CSAttributeDetail.attributeID,Equal<AttributeConstants.attributeConstID>>>),new Type[]
{
typeof(CSAttributeDetail.valueID),
typeof(CSAttributeDetail.description)
})]
public string UsrFakeField { get; set; }
public abstract class usrFakeField : BqlType<IBqlString, string>.Field<usrFakeField> { }
#endregion
}
Result:
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.