首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >向Acumatica Mobile中的选择器添加过滤器

向Acumatica Mobile中的选择器添加过滤器
EN

Stack Overflow用户
提问于 2017-10-20 23:58:27
回答 1查看 280关注 0票数 0

我们目前已经将仓库/仓位转移添加到Acumatica Mobile,以允许用户通过Mobile进行仓位转移,而不是使用Acumatica。

我们已经在with SelectorContainer语句中将QtyAvailable添加到From和to Bin选择器中。然而,有没有一种方法可以只过滤出项目的那些记录,而不是显示所有的垃圾箱/位置。此筛选器将仅位于from位置。目标位置仍将显示所有位置。

EN

回答 1

Stack Overflow用户

发布于 2017-10-30 08:03:40

仅显示具有数量的箱位/位置。大于0,则应扩展LocationAvailAttribute修饰INTran.LocationID字段的Where条件:

代码语言:javascript
复制
using PX.Data;
using System;

namespace PX.Objects.IN
{
    public class INTransferEntryExt : PXGraphExtension<INTransferEntry>
    {
        [PXRemoveBaseAttribute(typeof(LocationAvailAttribute))]
        [PXMergeAttributes(Method = MergeMethod.Append)]
        [LocationAvailCst(typeof(INTran.inventoryID), typeof(INTran.subItemID), 
            typeof(INTran.siteID), typeof(INTran.tranType), typeof(INTran.invtMult))]
        public virtual void INTran_LocationID_CacheAttached(PXCache sender)
        {
        }

        public class LocationAvailCstAttribute : LocationAvailAttribute
        {
            public LocationAvailCstAttribute(Type inventoryType, Type subItemType, 
                Type siteIDType, Type TranType, Type InvtMultType)
                : base(inventoryType, subItemType, siteIDType, TranType, InvtMultType)
            {
                var attr = _Attributes[_SelAttrIndex] as PXDimensionSelectorAttribute;
                var dimAttr = attr.GetAttribute<PXDimensionAttribute>();
                var selAttr = attr.GetAttribute<PXSelectorAttribute>();
                var select = selAttr.GetSelect();
                select = select.WhereAnd<Where<INLocationStatus.qtyAvail, Greater<Zero>>>();
                var newAttr = new PXDimensionSelectorAttribute(DimensionName,
                    select.GetType(), typeof(INLocation.locationCD),
                    new Type[]
                    {
                        typeof(INLocation.locationCD),
                        typeof(INLocationStatus.qtyOnHand),
                        typeof(INLocationStatus.qtyAvail),
                        typeof(INLocationStatus.active),
                        typeof(INLocation.primaryItemID),
                        typeof(INLocation.primaryItemClassID),
                        typeof(INLocation.receiptsValid),
                        typeof(INLocation.salesValid),
                        typeof(INLocation.transfersValid),
                        typeof(INLocation.projectID),
                        typeof(INLocation.taskID)
                    });
                _Attributes[_SelAttrIndex] = newAttr;
                newAttr.ValidComboRequired = attr.ValidComboRequired;
                newAttr.CacheGlobal = attr.CacheGlobal;
                newAttr.DirtyRead = attr.DirtyRead;
                newAttr.DescriptionField = attr.DescriptionField;
            }
        }
    }
}

在INTran.LocationID字段中添加自定义LocationAvailCstAttribute后,位置选择器将仅显示当前库存项目数量的仓位/位置。Available大于0:

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/46852910

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档