Search code examples
acumatica

PXView does not contain a definition for Select In Acumatica


I faced such a problem and how I can not overcome:

PXView does not contain a definition for Select and the best extension method overload EnumerableEx.Select<T>(IEnumerable)

My goal is to pass different views to the method, for example, I did it this way and it works with a specific type and a specific view.

var grid = Transaction.Select<TSITransaction>().ToList();

But the problem is that I don't know which view is coming to me

public void ValidationTabInformation<T, K, U>(string viewName, PXView viewQuery, PXView viewQueryCache, PXView cascadindView, PXView enablingConditions) 
            where T: TSNTagQueries
            where K: TSNWCascade
            where U: TSNTransConditions
        {
            var grid = viewQuery.SingleToArray().Select<T>().ToList();
            var cascading = cascadindView.SingleToArray().Select<K>().ToList();
            var deleted = viewQueryCache.Cache.Deleted.RowCast<T>().ToList();
            var conditions = enablingConditions.SingleToArray().Select<U>().ToList();
            var isRequired = string.Empty;
                //... doing something
        }




protected void DataFieldValidation()
        {
            //ValidationAsset();
            //ValidationEmployee();
            //ValidationTransaction();
            //ValidationLinkInfo();
            ValidationTabInformation<TSNAsset, TSNCascadeAsset, TSNAssetConditions>(Asset.Name, Asset.View, Asset.View,CascadingAsset.View, TagAssetEnablingConditions.View);
        }

Exception:

https://i.sstatic.net/ad4fO.png


Solution

  • Try something like this

    var grid = viewQuery.SelectMultiBound(new object[] {T});