如何使用Acumatica Contract API更改库存项目ID

如何使用Acumatica Contract API更改库存项目ID,acumatica,Acumatica,我想使用contract API更改项目的库存ID。看起来我应该能够做到这一点,但我想我缺少了如何将新的InventoryID发送到调用的方法 我正在使用添加了ChangeID方法的web服务端点。在参数下,我添加了一个名为key并映射到CD的参数(该字段在对话框中被调用,在变更项目订单示例中如何使用),但我并不清楚如何通过映射对象进行关联 我有这个密码: Dim strItemCode As String=“18r1” Dim-ItItem As-StockItem=soapClient.Ge

我想使用contract API更改项目的库存ID。看起来我应该能够做到这一点,但我想我缺少了如何将新的InventoryID发送到调用的方法

我正在使用添加了ChangeID方法的web服务端点。在参数下,我添加了一个名为key并映射到CD的参数(该字段在对话框中被调用,在变更项目订单示例中如何使用),但我并不清楚如何通过映射对象进行关联

我有这个密码:

Dim strItemCode As String=“18r1”
Dim-ItItem As-StockItem=soapClient.Get(新的StockItem带有{
.InventoryID=New StringSearch,带{.Value=strItemCode},
.WarehouseDetails=New StockItemWarehouseDetail(){New StockItemWarehouseDetail With{.ReturnBehavior=ReturnBehavior.All}})
将InvokedResult设置为InvokeResult=soapClient.Invoke(item,带有{.key=New-StringValue和{.Value=“18r1TJK”}的新ChangeID)
它一直工作到它确实加载了该项,但是当我尝试调用的结果时,我得到了一个错误。这个错误看起来好像我传递了错误的参数,这当然是有道理的,但是文档中有一些非常接近这个的东西,所以我想我会尝试一下。提前谢谢

System.ServiceModel.FaultException
  HResult=0x80131501
  Message=System.ArgumentNullException: Value cannot be null.
Parameter name: key
   at PX.Api.ContractBased.Soap.WebApiSoapController.Post(ISoapSystemContract systemContract, XmlReader requestReader, String serviceNamespace, String internalNamespace, MethodInfo method, Func`1 serviceFactory, IEdmModel edmModel)
   at PX.Api.ContractBased.Soap.WebApiSoapController.<Post>d__8.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at PX.Api.ContractBased.Soap.WebApiSoapController.<Login>d__6.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Threading.Tasks.TaskHelpersExtensions.<CastToObject>d__3`1.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Web.Http.Controllers.ApiControllerActionInvoker.<InvokeActionAsyncCore>d__0.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Web.Http.Controllers.ActionFilterResult.<ExecuteAsync>d__2.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Web.Http.Controllers.ExceptionFilterResult.<ExecuteAsync>d__0.MoveNext()
  Source=mscorlib
  StackTrace:
   at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)
   at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)
   at InventoryEditor.ServiceReference1.DefaultSoap.Invoke(Entity entity, Action action)
   at InventoryEditor.ServiceReference1.DefaultSoapClient.Invoke(Entity entity, Action action) in C:\Data Files\InventoryEditor\InventoryEditor\InventoryEditor\Connected Services\ServiceReference1\Reference.vb:line 65002
   at InventoryEditor.Form1.Button1_Click(Object sender, EventArgs e) in C:\Data Files\InventoryEditor\InventoryEditor\InventoryEditor\Form1.vb:line 24
   at System.Windows.Forms.Control.OnClick(EventArgs e)
   at System.Windows.Forms.Button.OnClick(EventArgs e)
   at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)
   at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
   at System.Windows.Forms.Control.WndProc(Message& m)
   at System.Windows.Forms.ButtonBase.WndProc(Message& m)
   at System.Windows.Forms.Button.WndProc(Message& m)
   at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
   at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
   at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
   at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)
   at System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(IntPtr dwComponentID, Int32 reason, Int32 pvLoopData)
   at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
   at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
   at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.OnRun()
   at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.DoApplicationModel()
   at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.Run(String[] commandLine)
   at InventoryEditor.My.MyApplication.Main(String[] Args) in :line 81
System.ServiceModel.FaultException
HResult=0x8013151
Message=System.ArgumentNullException:值不能为null。
参数名称:key
位于PX.Api.ContractBased.Soap.WebApiSoapController.Post(ISoapSystemContract systemContract、XmlReader requestReader、String serviceNamespace、String internalNamespace、MethodInfo方法、Func`1 serviceFactory、IEdmModel edmModel)
在PX.Api.ContractBased.Soap.WebApiSoapController.d_u8.MoveNext()中
---来自引发异常的上一个位置的堆栈结束跟踪---
在System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()中
在System.Runtime.CompilerServices.TaskWaiter.HandleNonSuccessAndDebuggerNotification(任务任务)中
在PX.Api.ContractBased.Soap.WebApiSoapController.d_u6.MoveNext()中
---来自引发异常的上一个位置的堆栈结束跟踪---
在System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()中
在System.Runtime.CompilerServices.TaskWaiter.HandleNonSuccessAndDebuggerNotification(任务任务)中
在System.Threading.Tasks.TaskHelperExtensions.d_u3`1.MoveNext()中
---来自引发异常的上一个位置的堆栈结束跟踪---
在System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()中
在System.Runtime.CompilerServices.TaskWaiter.HandleNonSuccessAndDebuggerNotification(任务任务)中
在System.Web.Http.Controllers.ApiControllerActionInvoker.d_u0.MoveNext()中
---来自引发异常的上一个位置的堆栈结束跟踪---
在System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()中
在System.Runtime.CompilerServices.TaskWaiter.HandleNonSuccessAndDebuggerNotification(任务任务)中
在System.Web.Http.Controllers.ActionFilterResult.d_u2.MoveNext()中
---来自引发异常的上一个位置的堆栈结束跟踪---
在System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()中
在System.Runtime.CompilerServices.TaskWaiter.HandleNonSuccessAndDebuggerNotification(任务任务)中
在System.Web.Http.Controllers.ExceptionFilterResult.d_u0.MoveNext()中
Source=mscorlib
堆栈跟踪:
at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg,IMessage retMsg)
at System.Runtime.Remoting.proxy.RealProxy.PrivateInvoke(MessageData&msgData,Int32类型)
在InventoryEditor.ServiceReference1.DefaultSoap.Invoke(实体,动作)
在C:\Data Files\InventoryEditor\InventoryEditor\InventoryEditor\InventoryEditor\Connected Services\ServiceReference1\Reference.vb中的Invoke(实体,动作)目录下的Invoke.ServiceReference1.DefaultSoapClient.Invoke(实体,动作)目录下
在InventoryEditor.Form1.Button1\单击C:\Data Files\InventoryEditor\InventoryEditor\InventoryEditor\Form1.vb:第24行中的(对象发送者,事件参数e)
在System.Windows.Forms.Control.OnClick(EventArgs e)中
在System.Windows.Forms.Button.OnClick(EventArgs e)中
在System.Windows.Forms.Button.OnMouseUp(MouseEventArgs-mevent)上
在System.Windows.Forms.Control.WmMouseUp(Message&m、MouseButtons按钮、Int32单击)
位于System.Windows.Forms.Control.WndProc(Message&m)
位于System.Windows.Forms.ButtonBase.WndProc(Message&m)
在System.Windows.Forms.Button.WndProc(Message&m)中
在System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message&m)中
在System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message&m)中
在System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd、Int32 msg、IntPtr wparam、IntPtr lparam)
在System.Windows.Forms.UnsafentiveMethods.DispatchMessageW(MSG&MSG)中
位于System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafentiveMethods.IMsoComponentManager.FPushMessageLoop(IntPtr dwComponentID、Int32 reason、Int32 pvLoopData)
位于System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32原因,ApplicationContext上下文)
位于System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32原因,ApplicationContext上下文)
在Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.OnRun()上
在Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.DoApplicationModel()上
在Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.Run(字符串[]命令行)
在InventoryEditor.My.MyApplication.Main(字符串[]Args)的第81行

事实证明,在这里发帖是我找到答案所需要的灵感。诀窍是在创建WSE扩展时使用“填充”。然后,您可以搜索该对话框,它会将正确的结果填充到参数和boom、项目代码重命名中