问题描述
在一个新按钮上生成一个弹出窗口,单击 stock stocks屏幕,在弹出窗口内部有两个按钮,用户从弹出窗口的字段中选择一些数据,然后单击确定,然后应该使用一些特殊字符来形成stockerId应该显示在InventoryID字段中。我可以形成InventoryID,但无法在InventoryID字段中显示它。
am generating a pop on one new button click in stock Items screen, inside popup have two buttons, user select some data from fields in the popup and then click on ok, then inventoryId should be formed with some special characters and then it should display in InventoryID field. I can form the InventoryID but unable to display it in InventoryID field.
[PXButton]
[PXUIField(DisplayName = "Generate")]
public virtual void GenerateInv()
{
InventoryItemExt ext = Base.Item.Cache.GetExtension<InventoryItemExt>(Base.Item.Current);
Base.Item.Current.InventoryCD = ext.UsrInvId;
Base.Item.Cache.Insert(Base.Item.Current);
}
推荐答案
我以前遇到过此问题,
,以下代码由acumatica提供。您可以尝试相同的方法。
I had this issue before,and the following code was provided by acumatica. you may try the same.here in the below code, inventoryCD contains the value, i wanted to set.
InventoryItem item = PXCache<InventoryItem>.CreateCopy(Base.Item.Current);
OrderedDictionary keys = new OrderedDictionary(StringComparer.OrdinalIgnoreCase)
{
{
typeof(InventoryItem.inventoryCD).Name,
adapter.View.Cache.GetValue(adapter.View.Cache.Current,
typeof(InventoryItem.inventoryCD).Name)
}
};
OrderedDictionary vals = new OrderedDictionary(StringComparer.OrdinalIgnoreCase)
{
{
typeof(InventoryItem.inventoryCD).Name, inventoryCD
}
};
adapter.View.Cache.Update(keys, vals);
if (adapter.Searches != null && adapter.Searches.Length > 0)
{
adapter.Searches[0] = inventoryCD;
}
return adapter.Get();
还要确保您的函数具有正确的输入和返回类型
Also make sure your function have the correct input and the return type
IEnumerable GenerateInv(PXAdapter adapter)
这篇关于将值从弹出窗口加载到InventoryID字段的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!