Setup:
- Turn on manual numbering for Sales Quotes
- Make a web endpoint for Sales Quotes with OpportunityID and QuoteNbr mapped along with either of two mapped actions: PrimaryQuote or MarkAsConverted (QuoteEndpoint customization attached)
- Create an Opportunity
- Create two Quotes on that Opportunity
When I attempt to mark the first quote as primary via POST request to /entity/Quote/0.1/SalesQuote/PrimaryQuote:
{
"entity": {
"OpportunityID": {
"value": "261044"
},
"QuoteNbr": {
"value": "261044R00"
}
}
}I get this error response:
{
"message": "An error has occurred.",
"exceptionMessage": "Object reference not set to an instance of an object.",
"exceptionType": "System.NullReferenceException",
"stackTrace": " at PX.Api.ContractBased.EntityService.Invoke(ISystemContract systemContract, String version, String name, EntityImpl entity, ActionImpl action, CbOperationContext operationContext, Boolean throwOnError)\r\n at PX.Api.ContractBased.AspNetCore.CbEndpointFeatureServiceExtensions.Invoke(IEntityService entityService, ICbEndpointFeature feature, EntityImpl entity, ActionImpl action, CbOperationContext operationContext)\r\n at PX.Api.ContractBased.WebApi.Controllers.ActionController.InvokeAction(String objectName, String actionName, ActionInvocation invocation)\r\n at lambda_method(Closure , Object , Object[] )\r\n at Microsoft.AspNetCore.Mvc.Internal.ActionMethodExecutor.SyncActionResultExecutor.Execute(IActionResultTypeMapper mapper, ObjectMethodExecutor executor, Object controller, Object[] arguments)\r\n at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.<InvokeActionMethodAsync>d__12.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 Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.<InvokeNextActionFilterAsync>d__10.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 Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.Rethrow(ActionExecutedContext context)\r\n at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)\r\n at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.<InvokeInnerFilterAsync>d__13.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 Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.<InvokeNextExceptionFilterAsync>d__24.MoveNext()"
}Marking the second or third quote as primary works, only the first throws this error.
Same request but referencing the second quote:
{
"entity": {
"OpportunityID": {
"value": "261044"
},
"QuoteNbr": {
"value": "261044R01"
}
}
}Gets a 204 response and marks the 261044R01 quote as primary:

Related to my previous topic: https://community.acumatica.com/topic/show?tid=26964&fid=289
Marking quotes as primary works fine in the normal web interface, this only affects API requests. If the request is sent for a quote that is already primary, I instead get the expected "PX.Data.PXInvalidOperationException" for all quotes.
Is there anything I can try to make this work?