Modify Selector Default Sorting

时光怂恿深爱的人放手 提交于 2019-12-13 00:45:36

问题


I want to modify the selector of the Order Nbr field in the SO Order Entry screen to be sorted by the Order Date in descending order by default. I tried to modify the SO.RefNbr adding a Desc<SOOrder.orderType> to the OrderBy<>...

[PXMergeAttributes(Method = MergeMethod.Merge)]
[SO.RefNbr(typeof(Search2<SOOrder.orderNbr,
    LeftJoinSingleTable<Customer, On<SOOrder.customerID, Equal<Customer.bAccountID>,
        And<Where<Match<Customer, Current<AccessInfo.userName>>>>>>,
    Where<SOOrder.orderType, Equal<Optional<SOOrder.orderType>>,
    And<Where<SOOrder.orderType, Equal<SOOrderTypeConstants.transferOrder>,
        Or<Customer.bAccountID, IsNotNull>>>>,
    OrderBy<Desc<SOOrder.orderDate, Desc<SOOrder.orderNbr>>>>), Filterable = true)]
public virtual void SOOrder_OrderNbr_CacheAttached(PXCache sender) { }

However, that had no affect. Interestingly if I remove the Desc<SOOrder.orderNbr> portion of the OrderBy<> term it results in the items in the Selector still being sorted by the Order Nbr but now in Ascending order. Is it possible to sort Selectors by fields other than their referenced search field?


回答1:


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



来源:https://stackoverflow.com/questions/47205078/modify-selector-default-sorting

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!