My Products
Help
kashyap
PARTNER

Exception while saving sales order

by kashyap
- Result Failed:: VismaId: 6804761a-14dd-42a0-9b9d-73895ce15872. Error creating salesOrder. System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> PX.Data.PXForeignRecordDeletedException: Error: The record has been deleted.
   at PX.Data.PXSelectorAttribute.SubstituteKeyFieldUpdating(PXCache sender, PXFieldUpdatingEventArgs e)
   at PX.Data.PXDimensionSelectorAttribute.FieldUpdating(PXCache sender, PXFieldUpdatingEventArgs e)
   at PX.Objects.IN.CrossItemAttribute.FieldUpdating(PXCache sender, PXFieldUpdatingEventArgs e) in D:\Data\BuildAgent\work\11023e52ea15d342\Web\Pure\PX.Objects\IN\Descriptor\Attribute.cs:line 8157
   at PX.Data.PXCache.OnFieldUpdating(String name, Object row, Object& newValue)
   at PX.Data.PXCache`1.SetValueExt(Object data, String fieldName, Object value)
   --- End of inner exception stack trace ---
   at Visma.net.ERP.Api.Base.BaseDomain.HandleChildCommand(IBaseCommand cmd, Boolean handleChildCommands) in D:\Data\BuildAgent\work\11023e52ea15d342\Web\Lib\Visma.net.ERP.Api\Base\BaseDomain.cs:line 72
   at Visma.net.ERP.Api.Base.BaseDomain.ApplyChildCommands(IEnumerable`1 childCommands, Boolean handleChildCommands) in D:\Data\BuildAgent\work\11023e52ea15d342\Web\Lib\Visma.net.ERP.Api\Base\BaseDomain.cs:line 44
   at Visma.net.ERP.Api.SO.CommandModel.SoCommandHandler.Handle_V2(ICreateSalesOrderCommand[] cmdList) in D:\Data\BuildAgent\work\11023e52ea15d342\Web\Lib\Visma.net.ERP.Api\SO\CommandModel\SoCommandHandler.cs:line 83
   at Visma.net.ERP.Web.Api.Repositories.SOOrderWebRepository.CreateSaleOrderReturnSaleOrderNumber(SalesOrderUpdateDto salesOrderUpdateDto, String orderType, Int32 version) in D:\Data\BuildAgent\work\11023e52ea15d342\Web\Lib\Visma.net.ERP.Web.Api\Repositories\SOOrderWebRepository.cs:line 178
Error: The record has been deleted.
4 REPLIES 4

by Magnus Johnsen

Hi,

Please let us know what operation you are performing and include the JSON.

Thank you. 

kashyap
PARTNER

by kashyap (Updated ‎21-06-2022 07:43 by kashyap PARTNER )

Request URL: controller/api/v2/salesorder

Please check attached document

by Magnus Johnsen

Hi,

Please check if any of the items in the salesOrder has been set to inactive or been removed from the system.

 

We'll report the issue that the stack trace is returned in the error message. 

kashyap
PARTNER

by kashyap

Manually checked in UI all products are exists and active