如何获取自定义字段值 acumatica

我是开发 acumatica 的新手,我一直致力于获取我创建的自定义 TextEdit 字段的值。我可以通过这段代码获取所有内置字段值


InventoryItem items = (InventoryItem)Base.Item.Cache.Current;

但我无法获得我在 acumatica 定制中创建的那个,这是我想要获得的字段


https://i.stack.imgur.com/gPln4.png


我已经尝试过了


InventoryItem items = (InventoryItem)Base.ItemSettings.Cache.Current;


var shortdesc = items.UsrShortDescription;

但它不起作用,并且不显示文本框中的值,提前感谢您的帮助


茅侃侃
浏览 136回答 3
3回答

幕布斯6054654

InventoryItem items = (InventoryItem)Base.ItemSettings.Current;var itemExt = PXCache<InventoryItem>.GetExtension<InventoryItemExt>(items);var shortdesc = itemExt.UsrShortDescription;

白板的微信

Vardan 展示了一种方式,为了图片的完整性,还想展示另一种方式:InventoryItem&nbsp;items&nbsp;=&nbsp;(InventoryItem)Base.ItemSettings.Current; var&nbsp;itemExt&nbsp;=&nbsp;items.GetExtension<InventoryItemExt>();

慕桂英4014372

这是从非扩展字段获取值的示例。我没有使用扩展 DAC 将礼品卡字段添加到商店设置屏幕。在一种方法中,我需要获取该字段的值。我应该检查订单是否包含礼品卡商品。&nbsp;public static bool GiftcardName(OrderModel orders, BZWoocommerceStore store)&nbsp;{&nbsp; &nbsp; &nbsp;// "ZGift CArd W" => "giftcard"&nbsp; &nbsp; &nbsp;string wooCommName = string.Empty;&nbsp; &nbsp; &nbsp;string wooCommNameNoSpases = string.Empty;&nbsp; &nbsp; &nbsp;bool containsGiftcardName = false;&nbsp; &nbsp; &nbsp;bool isGiftcard = false;&nbsp; &nbsp; &nbsp;foreach (OrderLineModel line in orders.LineItems)&nbsp; &nbsp; &nbsp;{&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;string gNameInAcumatica = store.GiftcardIdentifier;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;string gNameInAcumaticaWithoutSpaces = gNameInAcumatica.Replace(" ", "");&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;wooCommName = line.Name; //pattern&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;wooCommNameNoSpases = wooCommName.Replace(" ", "");&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;//wooCommNameNoSpases =&nbsp; new string(wooCommName.ToCharArray()&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;//&nbsp; &nbsp; .Where(c => !Char.IsWhiteSpace(c))&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;//&nbsp; &nbsp; .ToArray());&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;//woCommNameNoUperCase= wooCommNameNoSpases.ToLower();&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;//isGiftcardName= woCommNameNoUperCase.Contains(gName);&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;//containsGiftcardName = wooCommNameNoSpases.Contains(gName);&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;containsGiftcardName = Regex.IsMatch(wooCommNameNoSpases, gNameInAcumaticaWithoutSpaces, RegexOptions.IgnoreCase);&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;if(containsGiftcardName)&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;{&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;isGiftcard = true;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;}&nbsp; &nbsp; &nbsp;}&nbsp; &nbsp; &nbsp;return isGiftcard;&nbsp;}因此,当我调用这个方法时,我给出了两个参数:orders和store。store参数就是这样创建的。&nbsp; &nbsp; &nbsp;public PXSelect<BZWoocommerceOrder> Order;我在一个动作方法中写了这个。string storeCode = this.Order.Current.StoreCode;BZWoocommerceStore store = PXSelect<BZWoocommerceStore, Where<BZWoocommerceStore.storeCode, Equal<Required<BZWoocommerceStore.storeCode>>>>.Select(this, storeCode);我的GiftcardName()方法查看原始字段的值。写“原创”我的意思是你不使用任何像这样的技术。BZSOOrderExt rowExt = sender.GetExtension<BZSOOrderExt>(row);
打开App,查看更多内容
随时随地看视频慕课网APP