所以我添加了使用当前BAccount.BAccountID创建新销售订单的操作,我收到此错误"值不能为空.参数名称:密钥".任何人都可以具体看到我做错了什么吗?我假设customerID和BAccountID是等价的,因为它们对ID保持相同的值.
public PXAction<BAccount> KSSOOrderPush;
[PXUIField(DisplayName = "Create New Sales Order", MapEnableRights = PXCacheRights.Select, MapViewRights = PXCacheRights.Select)]
[PXButton(CommitChanges = true)]
protected virtual void kSSOOrderPush()
{
//Must use Base.BAccount.Current INSTEAD of BAccount.Current
BAccount bacct = Base.BAccount.Current;
if (bacct == null || bacct.BAccountID == null) return;
//Create instance of graph
SO.SOOrderEntry graph = PXGraph.CreateInstance<SO.SOOrderEntry>();
graph.Document.Current = graph.Document.Search<SOOrder.customerID>(bacct.BAccountID);
throw new PXRedirectRequiredException(graph, "Sales Order");
}
Run Code Online (Sandbox Code Playgroud) acumatica ×1