to get a personalized navigation.
to get a personalized navigation.
Greetings 🙂
We are attempting to create a sales order with stock items in combination with the Project Accounting module using the following endpoint: POST /controller/api/v2/salesorder
(POST-json at bottom of post)
However there comes no Project on the order. If I use the default "project" instead of "projectCD" with the internal ID project number I am able to get this error message that suggests that project is in but not the task.
"message": "Error: Inserting 'Sales order line' record raised at least one error. Please review the errors.\r\n'Project task' cannot be empty.\r\n"
}
I am not able to get the task in at all. Not with projectTaskCD with GUI ID and not projectTask with internal task ID or GUI ID.
There is of course also the issue that we can't set the sub-account in the same post because it is always overridden by the item settings, but this can at least in a worst case scenario be solved by an additional PUT afterwards.
Any suggestions or ideas?
{
"projectCD": {
"value": "00002"
},
"lines": [
{
"subaccount": [
{
"segmentId": 1,
"segmentValue": "13"
}
],
"operation": "Insert",
"lineNbr": {
"value": 1
},
"inventoryNumber": {
"value": "0S3565"
},
"warehouse": {
"value": "L"
},
"projectTaskCD": {
"value": "100"
},
"quantity": {
"value": 1
},
"unitPrice": {
"value": 1
}
}
],
"orderType": {
"value": "SO"
},
"date": {
"value": "2022-11-07T13:51:01.913Z"
},
"customer": {
"value": "30020"
}
}
Solved! Go to Solution.
Ah, thanks! Seems like there was a combination that was not tried.
Perhaps remove the ProjectCD field from the SalesOrderDto and ProjectTaskCD field from the SalesOrderLineDto to avoid future confusion?
Ah, ok, so just available in get and not post.
Hello Eirik,
the field exposed via Sales Order Endpoint (saleOrderUpdateDto) is
{ "project": { "value": 0 }
this field requires the value of the Project's "Internal ID" that can be retrieved from GET Project/{ProjectID}
then we should send the following fields in the payload (SalesOrder Header), based on your project defined in the company
"project":
{"value": 7692}
SalesOrderLine
"projectTask":
{"value": "01"}
Example JSON:
Financials ERP Output:
Project (ScreenId=PM301000)
SalesOrder (ScreenId=SO301000)
SalesOrderLine
We'll inform development team to improve the documentation of the field that to specify it requires the "InternalID" of the project.
Regards.
Copyright © 2022 Visma.com. All rights reserved.