How To Make Selector For Csanswers
Hello everybody,
recently one of the colleagues asked me how to make selector from Attributes values. Also that request seem trivial, but still took some time, especially with usage of FBQL query to build.
Below goes template you may use if you'll need some kind of selector for attributes by some predefined value:
public class SOOrderExt : PXCacheExtension<SOOrder> { public class Codes { public const string MediaCode = "MEDIACODE"; public class mEdiaCode : BqlType<IBqlString, string>.Constant<mEdiaCode> { public mEdiaCode() : base("mEdiaCode") { } } public const string OrdOrigin = "ORDORIGIN"; public class ordOrigin : BqlType<IBqlString, string>.Constant<ordOrigin> { public ordOrigin() : base("ORDORIGIN") { } } } [PXSelector(typeof(SearchFor<CSAnswers.value>.Where<CSAnswers.attributeID.IsEqual<Codes.ordOrigin>>))] [PXDBString(50)] public string SomeValue1 { get; set; } [PXSelector(typeof(SearchFor<CSAnswers.value>.Where<CSAnswers.attributeID.IsEqual<Codes.mEdiaCode>>))] [PXDBString(50)] public string SomeValue { get; set; } }
For me it was also interesting to note, that in the past it was common to use for Selector combination of PXSelector with Search, but in FBQL you'll need PXSelector with SearchFor.
If you found this Acumatica development tip on creating selectors from Attributes values helpful, why not take it a step further? Every business has unique needs, and customization is key to unlocking Acumatica's full potential. Whether you need a tailored solution for your workflows, reporting, or integrations, our team is here to help.
Leave a customization request today and let us build the perfect solution for your business. Your vision, our expertise—let’s make it happen!