Skip to main content

Hello,

I want to sort data displayed in PXSelector by LineNbr
here the Selector:

 PXSelector(typeof(Search<Choixfournisseur.inventoryCD, Where<Choixfournisseur.reqNbr, Equal<Current<Choixfournisseur.reqNbr>>>,OrderBy<Asc<Choixfournisseur.lineNbr>>>), new Type ] { typeof(Choixfournisseur.lineNbr), typeof(Choixfournisseur.orderQty),typeof(Choixfournisseur.itemDesc),typeof(Choixfournisseur.curyEstUnitCost),typeof(Choixfournisseur.curyEstExtCost),typeof(Choixfournisseur.inventory) },ValidateValue = false, Filterable = true)]

 

But it dosn’t work 


Thanks for your feedback.
 

Hi @julienf99,

Did you get any solution on this?

 

Regards,

Ramya


This does not work. The order of the GetRecords does not affect the order of the Selector display at all! I spent numerous hours trying this. I do not understand why Acumatica does not give a solution for this obvious issue.


Hi @SadokHanini 

 PXSelectorAttribute will only sort by key(foreign) or a substitute key. Any other field used on the sort won't affect the sorting.

Just you can give a try with custom selector.

Here is the sample code for custom Selector

        ÂPXDBString(IsUnicode = true)]
          TaxzoneSelector]
                public string TaxZone { get; set; }

        public abstract class taxZone : BqlString.Field<taxZone> { }



 internal class TaxzoneSelectorAttribute : PXCustomSelectorAttribute
    {        
        public PXSelect<TaxZone> Taxzones;
        public TaxzoneSelectorAttribute() : base(typeof(TaxZone.taxZoneID))
        { }
        protected virtual IEnumerable GetRecords()
        {
            object setup = this._Graph.ViewsR"KCFPluginSetup"].Cache.Current;
            CFPluginSetup setup1 = (CFPluginSetup)setup;
            SCPluginSetupExtn extn = setup1.GetExtension<KNSCPluginSetupExtn>();
            if (extn?.TaxZonePreference == SCConstants.ImportManual && !this._Graph.IsCopyPasteContext)
            {
                return PXSelect<TaxZone, Where<TaxZone.isExternal, Equal<False>>>.Select(this._Graph).RowCast<TaxZone>().ToList();
            }
            else
                return PXSelect<TaxZone>.Select(this._Graph).RowCast<TaxZone>().ToList();
        }
    }

 


 


Reply