Hey team, need some assistance with creating subcontracts via rest api. Looks like subcontracts are just a type of the PO (which im able to create via api without a problem), but if I pass PO type as Subcontract Im getting an error :
\"exceptionMessage\": \"Cannot generate the next number for the sequence.\",
Anybody had any luck creating Subcontracts via API?
C# library Acumatica.Default_22_200_001.Model PurchaseOrder model
Page 1 / 1
@dpruckus - I suggest extending the endpoint to a new name via the 22.200.001 version. Then I would look at the segmented keys ID for subcontracts -> numbering ID and see if you have a numbering id which is generating the number sequences populated. If not you should create one and it should resolve that error via the API.
@dpruckus- I suggest extending the endpoint to a new name via the 22.200.001 version. Then I would look at the segmented keys ID for subcontracts -> numbering ID and see if you have a numbering id which is generating the number sequences populated. If not you should create one and it should resolve that error via the API.
Hey Steven. Thanks for your reply. Can you elaborate a little bit more? I have already extended my endpoint but I cant seem to find anything about subcontracts there. Thanks!
@dpruckus
Could you please share some screenshots of what you trying to achieve and what is the behavior via UI(screen ID, some example)
@dpruckus
Could you please share some screenshots of what you trying to achieve and what is the behavior via UI(screen ID, some example)
So instead of PO, Im trying to create Subcontract.
It works fine on UI, but via API it gives me the above error if I use POModel and set Type = “Subcontract”.
POs are created fine via API if Type = “Normal” or Type=’Project Drop-Ship’ It seems to me that Subcontracts are the same POs (same module) but Im still not sure how to set PO type to be Subcontract.
@dpruckus UI actions used to populate data/grid are not (I believe) supported via API.
@dpruckus UI actions used to populate data/grid are not (I believe) supported via API.
Im sorry, what? That doesn't make any sense, sorry.
@dpruckus
from the screenshot, “CREATE SUBCONTRACT” seems to an action.
Last time I checked, populating grid via UI Actions was not supported via APIs.
What is it different from Create PO?
@dpruckus are you able to execute Create PO action from API.
I checked the default endpoint definition but did not see any component relating to Create PO action:
Hi @dpruckus
I was able to create a sample Subcontract.
The solution was to extend the web service endpoint to expose the SubContract's screen and map the fields accordingly.
You can follow the blog post on extending the WebService Enpoint.