Solved

Bill.Details[0].POOrderNbr: A PO is required for this Vendor Error

  • 10 March 2022
  • 6 replies
  • 76 views

Userlevel 4
Badge +2

Hi, 

My application creates Bill in Acumatica via REST request 

URL : https://sandbox-21r2.acumatica.com/entity/ARTSEndpoint/18.200.001/Bill

Body : 

{

  "VendorRef": {

    "value": "19071450-21101"

  },

  "Description": {

    "value": ""1\""

  },

  "Vendor": {

    "value": "0600001521"

  },

  "Date": {

    "value": "02/22/2022"

  },

 

  "Details": [

    {

      "InventoryID": {

        "value": "OLIES"

      },

      "Project": {

        "value": "X"

      },

      "TransactionDescription": {

        "value": "Ly"

      },

      "Branch": {

        "value": "FOHIL"

      },

      "POReceiptNbr": {

        "value": "06007974"

      },

      "Qty": {

        "value": 1.0

      },

      "UnitCost": {

        "value": 23609.25

      },

      "Account": {

        "value": "68010"

      },

      "Subaccount": {

        "value": "4000000000"

      },

      "POReceiptLine": {

        "value": 1

      },

      "rowNumber": {

        "value": "1"

      }

    }

  ]

}

If I change only vendor on another one it works

What causes such behavior that it works with some Vendors but with others gives such error ?

 

icon

Best answer by Samuel Olivier Lavigueur 11 March 2022, 21:30

View original

6 replies

Userlevel 3
Badge +2

@Ivan 

Could you please past the whole stack trace of the error. (ideally in text format)

This could help understand where the error is being thrown.

 

Userlevel 4
Badge +2

@Ivan

Could you please past the whole stack trace of the error. (ideally in text format)

This could help understand where the error is being thrown

Hi@SLavigueur 

Sure,

{

    "message": "An error has occurred.",

    "exceptionMessage": "Bill.Details[0].POOrderNbr: A PO is required for this Vendor\nInserting  'AP Transactions' record raised at least one error. Please review the errors.",

    "exceptionType": "PX.Api.ContractBased.OutcomeEntityHasErrorsException",

    "stackTrace": "   at PX.Api.ContractBased.EntityService.GetOperationResult(EntityImpl entity, EntityExportContextBuilder entityExportContextBuilder, PXSYTable exportedKeys, PXOuterException contextError, Boolean throwOnError, Boolean addCancelCommand)\r\n   at PX.Api.ContractBased.EntityService.Put(ISystemContract systemContract, String version, String name, EntityImpl entity, CbOperationContext operationContext, Boolean throwOnError)\r\n   at PX.Api.ContractBased.Soap.SoapFacadeBase.PutImpl(EntityImpl entity, Boolean throwOnValidationError)\r\n   at PX.Api.ContractBased.SystemContracts.V2.RestController.PutEntity(EntityImpl entity, String select, String filter, String expand, String custom)\r\n   at lambda_method(Closure , Object , Object[] )\r\n   at System.Web.Http.Controllers.ReflectedHttpActionDescriptor.ActionExecutor.<>c__DisplayClass6_2.<GetExecutor>b__2(Object instance, Object[] methodParameters)\r\n   at System.Web.Http.Controllers.ReflectedHttpActionDescriptor.ExecuteAsync(HttpControllerContext controllerContext, IDictionary`2 arguments, CancellationToken cancellationToken)\r\n--- End of stack trace from previous location where exception was thrown ---\r\n   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n   at System.Web.Http.Controllers.ApiControllerActionInvoker.<InvokeActionAsyncCore>d__1.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n   at System.Web.Http.Filters.ActionFilterAttribute.<CallOnActionExecutedAsync>d__6.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n   at System.Web.Http.Filters.ActionFilterAttribute.<CallOnActionExecutedAsync>d__6.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n   at System.Web.Http.Filters.ActionFilterAttribute.<ExecuteActionFilterAsyncCore>d__5.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n   at System.Web.Http.Filters.ActionFilterAttribute.<CallOnActionExecutedAsync>d__6.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n   at System.Web.Http.Filters.ActionFilterAttribute.<CallOnActionExecutedAsync>d__6.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n   at System.Web.Http.Filters.ActionFilterAttribute.<ExecuteActionFilterAsyncCore>d__5.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n   at System.Web.Http.Controllers.ActionFilterResult.<ExecuteAsync>d__5.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n   at System.Web.Http.Filters.AuthorizationFilterAttribute.<ExecuteAuthorizationFilterAsyncCore>d__3.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n   at System.Web.Http.Controllers.ExceptionFilterResult.<ExecuteAsync>d__6.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n   at System.Web.Http.Controllers.ExceptionFilterResult.<ExecuteAsync>d__6.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n   at System.Web.Http.Dispatcher.HttpControllerDispatcher.<SendAsync>d__15.MoveNext()"

}

 

Userlevel 4
Badge +2

@Ivan

Could you please past the whole stack trace of the error. (ideally in text format)

This could help understand where the error is being thrown.

 

Hi @SLavigueur 

Did you have an opportunity to check my issue ?

Userlevel 3
Badge +2

I did an I was looking into a couple of thing as there were a couple of point I found curious.

If you can do not use the rowNumber field at the details level as this is a system field and does not need to be passed during the creation of a new record.

Also since there does not seem to be any custom field in your request could you try the same request but using the latest version of the default endpoint? (Default/20.200.001)

I am curious as to why the stack trace mentions the following:

“PX.Api.ContractBased.SystemContracts.V2.RestController.PutEntity(EntityImpl entity, String select, String filter, String expand, String custom)”

This should only be of use for the endpoint of version 5.30 and 6.0 and extended endpoint that uses them as a base.

But both of these endpoint should not be available on 21R2 which your sandbox seem to be using.

Userlevel 4
Badge +2

I did an I was looking into a couple of thing as there were a couple of point I found curious.

If you can do not use the rowNumber field at the details level as this is a system field and does not need to be passed during the creation of a new record.

Also since there does not seem to be any custom field in your request could you try the same request but using the latest version of the default endpoint? (Default/20.200.001)

I am curious as to why the stack trace mentions the following:

“PX.Api.ContractBased.SystemContracts.V2.RestController.PutEntity(EntityImpl entity, String select, String filter, String expand, String custom)”

This should only be of use for the endpoint of version 5.30 and 6.0 and extended endpoint that uses them as a base.

But both of these endpoint should not be available on 21R2 which your sandbox seem to be using.

Hi @SLavigueur 

Thank you for the response 

I changed request with Default endpoint.

the result remains the same

{

    "message": "An error has occurred.",

    "exceptionMessage": "Bill.Details[0].POOrderNbr: A PO is required for this Vendor\nInserting  'AP Transactions' record raised at least one error. Please review the errors.",

    "exceptionType": "PX.Api.ContractBased.OutcomeEntityHasErrorsException",

    "stackTrace": "   at PX.Api.ContractBased.EntityService.GetOperationResult(EntityImpl entity, EntityExportContextBuilder entityExportContextBuilder, PXSYTable exportedKeys, PXOuterException contextError, Boolean throwOnError, Boolean addCancelCommand)\r\n   at PX.Api.ContractBased.EntityService.Put(ISystemContract systemContract, String version, String name, EntityImpl entity, CbOperationContext operationContext, Boolean throwOnError)\r\n   at PX.Api.ContractBased.Soap.SoapFacadeBase.PutImpl(EntityImpl entity, Boolean throwOnValidationError)\r\n   at PX.Api.ContractBased.SystemContracts.V2.RestController.PutEntity(EntityImpl entity, String select, String filter, String expand, String custom)\r\n   at lambda_method(Closure , Object , Object[] )\r\n   at System.Web.Http.Controllers.ReflectedHttpActionDescriptor.ActionExecutor.<>c__DisplayClass6_2.<GetExecutor>b__2(Object instance, Object[] methodParameters)\r\n   at System.Web.Http.Controllers.ReflectedHttpActionDescriptor.ExecuteAsync(HttpControllerContext controllerContext, IDictionary`2 arguments, CancellationToken cancellationToken)\r\n--- End of stack trace from previous location where exception was thrown ---\r\n   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n   at System.Web.Http.Controllers.ApiControllerActionInvoker.<InvokeActionAsyncCore>d__1.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n   at System.Web.Http.Filters.ActionFilterAttribute.<CallOnActionExecutedAsync>d__6.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n   at System.Web.Http.Filters.ActionFilterAttribute.<CallOnActionExecutedAsync>d__6.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n   at System.Web.Http.Filters.ActionFilterAttribute.<ExecuteActionFilterAsyncCore>d__5.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n   at System.Web.Http.Filters.ActionFilterAttribute.<CallOnActionExecutedAsync>d__6.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n   at System.Web.Http.Filters.ActionFilterAttribute.<CallOnActionExecutedAsync>d__6.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n   at System.Web.Http.Filters.ActionFilterAttribute.<ExecuteActionFilterAsyncCore>d__5.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n   at System.Web.Http.Controllers.ActionFilterResult.<ExecuteAsync>d__5.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n   at System.Web.Http.Filters.AuthorizationFilterAttribute.<ExecuteAuthorizationFilterAsyncCore>d__3.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n   at System.Web.Http.Controllers.ExceptionFilterResult.<ExecuteAsync>d__6.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n   at System.Web.Http.Controllers.ExceptionFilterResult.<ExecuteAsync>d__6.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n   at System.Web.Http.Dispatcher.HttpControllerDispatcher.<SendAsync>d__15.MoveNext()"

}

Userlevel 4
Badge +2

I did an I was looking into a couple of thing as there were a couple of point I found curious.

If you can do not use the rowNumber field at the details level as this is a system field and does not need to be passed during the creation of a new record.

Also since there does not seem to be any custom field in your request could you try the same request but using the latest version of the default endpoint? (Default/20.200.001)

I am curious as to why the stack trace mentions the following:

“PX.Api.ContractBased.SystemContracts.V2.RestController.PutEntity(EntityImpl entity, String select, String filter, String expand, String custom)”

This should only be of use for the endpoint of version 5.30 and 6.0 and extended endpoint that uses them as a base.

But both of these endpoint should not be available on 21R2 which your sandbox seem to be using.

In addition to my previous comment, I tried it with endpoint version 18.200.001

After I changed it to newest version - 20.200.001. The form of response changed but message is the same 

 

{

    "id": "a823bf0f-7ba1-ec11-8183-0e7f2faa93b5",

    "rowNumber": 1,

    "note": {

        "value": ""

    },

    "error": "Inserting  'AP Transactions' record raised at least one error. Please review the errors.; Inserting  'AP Transactions' record raised at least one error. Please review the errors.",

    "Amount": {

        "value": 0.0

    },

    "ApprovedForPayment": {

        "value": false

    },

    "Balance": {

        "value": 0.00

    },

    "BranchID": {

        "value": "FOHIL"

    },

    "CashAccount": {

        "value": "11060"

    },

    "CurrencyID": {

        "value": "BSD"

    },

    "Date": {

        "value": "2022-02-15T00:00:00+00:00"

    },

    "Description": {

        "value": "docAlpha BatchID \"1\""

    },

    "Details": [

        {

            "id": "aa23bf0f-7ba1-ec11-8183-0e7f2faa93b5",

            "rowNumber": 1,

            "note": {

                "value": ""

            },

            "Account": {

                "value": "68010"

            },

            "Amount": {

                "value": 0.00

            },

            "Branch": {

                "value": "FOHIL"

            },

            "CalculateDiscountsOnImport": {},

            "Description": {

                "value": "Supplies - Office"

            },

            "ExtendedCost": {

                "value": 0.00

            },

            "InventoryID": {

                "value": "OFFICESUPPLIES"

            },

            "NonBillable": {

                "value": false

            },

            "POLine": {},

            "POOrderNbr": {

                "error": "A PO is required for this Vendor"

            },

            "POOrderType": {},

            "POReceiptLine": {},

            "POReceiptNbr": {},

            "Project": {

                "value": "X"

            },

            "ProjectTask": {},

            "Qty": {

                "value": 0.0

            },

            "Subaccount": {

                "value": "4000000000"

            },

            "TaxCategory": {

                "value": "OPEX"

            },

            "TransactionDescription": {

                "value": "Lysol Disinfectant Sprays"

            },

            "UnitCost": {

                "value": 23609.25

            },

            "UOM": {

                "value": "EA"

            },

            "custom": {}

        }

    ],

    "DueDate": {

        "value": "2022-02-15T00:00:00+00:00"

    },

    "Hold": {

        "value": true

    },

    "LastModifiedDateTime": {

        "value": "2022-03-11T20:37:31.46+00:00"

    },

    "LocationID": {

        "value": "MAIN"

    },

    "PostPeriod": {

        "value": "062022"

    },

    "ReferenceNbr": {

        "value": "<NEW>"

    },

    "Status": {

        "value": "On Hold"

    },

    "TaxTotal": {

        "value": 0.0

    },

    "Terms": {

        "value": "NET15"

    },

    "Type": {

        "value": "Bill"

    },

    "Vendor": {

        "value": "0600001521"

    },

    "VendorRef": {

        "value": "byIvan"

    },

    "custom": {}

}

Reply


About Acumatica ERP system
Acumatica Cloud ERP provides the best business management solution for transforming your company to thrive in the new digital economy. Built on a future-proof platform with open architecture for rapid integrations, scalability, and ease of use, Acumatica delivers unparalleled value to small and midmarket organizations. Connected Business. Delivered.
© 2008 — 2024  Acumatica, Inc. All rights reserved