I am able to add a project task to an existing project using an API. How can I add multiple tasks using the same API? Is this possible? What is the syntax?
Best answer by ruchikasharma23
View originalI am able to add a project task to an existing project using an API. How can I add multiple tasks using the same API? Is this possible? What is the syntax?
Best answer by ruchikasharma23
View originalHi
From your post, I assume you have extended and added the Tasks entity to the endpoint. If not you can map the Tasks entity like below,
Once mapped, you can use the following syntax to add multiple Tasks in a single request,
{
"ProjectID": {
"value": "INTERNAL23"
},
"Tasks": [
{
"TaskID": {
"value": "TaskOne"
},
"Description": {
"value": "Task One"
},
"Status": {
"value": "Active"
},
"DefaultCostAccount": {
"value": "40000"
},
"DefaultCostSubaccount": {
"value": "000000"
},
"DefaultSalesAccount": {
"value": "40000"
},
"DefaultSalesSubaccount": {
"value": "000000"
},
"CompletionMethod": {
"value": "Manual"
},
"BillingOption": {
"value": "By Billing Period"
},
"BillingRule": {
"value": "INTERNAL"
},
"BillSeparately": {
"value": false
},
"AllocationRule": {
"value": "CPINT"
}
},
{
"TaskID": {
"value": "TaskTwo"
},
"Description": {
"value": "Task Two"
},
"Status": {
"value": "Active"
},
"DefaultCostAccount": {
"value": "40000"
},
"DefaultCostSubaccount": {
"value": "000000"
},
"DefaultSalesAccount": {
"value": "40000"
},
"DefaultSalesSubaccount": {
"value": "000000"
},
"CompletionMethod": {
"value": "Manual"
},
"BillingOption": {
"value": "By Billing Period"
},
"BillingRule": {
"value": "INTERNAL"
},
"BillSeparately": {
"value": false
},
"AllocationRule": {
"value": "CPINT"
}
}
]
}
Hope that helps.! Good Luck,
I am looking at ProjectTask webservice endpoint. I noticed that you added tasks under the project webservice endpoint, but I am not able to do that. I am logged in as the administrator and so I do have all the privileges.
I have made changes to the Project endpoint and added ProjectTask. When I use this JSON to make a call from postman, I get an error.
The JSON is
{
"ProjectID": {
"value": "PROJ-24-0000006"
},
"Tasks": [
{
"note": {
"value": "a task for a project"
},
"ActivityHistory": [],
"Default": {
"value": false
},
"Description": {
"value": "DESCRIPTION 1"
},
"ExternalRefNbr": {
"value": "140783"
},
"ProjectID": {
"value": "PROJ-24-0000006"
},
"ProjectTaskID": {
"value": "CS-140783"
},
"Status": {
"value": "In Planning"
},
"TaskCategory": {
"value": "Products & Services"
}
},
{
"note": {
"value": "a task for a project"
},
"Default": {
"value": false
},
"Description": {
"value": "DESCRIPTION 2"
},
"ExternalRefNbr": {
"value": "140784"
},
"ProjectID": {
"value": "PROJ-24-0000006"
},
"ProjectTaskID": {
"value": "CS-140784"
},
"Status": {
"value": "In Planning"
},
"TaskCategory": {
"value": "Products & Services"
}
}
]
}
Hi
From the screenshot, I see the Mapped Object and Mapped Field columns aren’t populated.
You should be able to simply map the Tasks fields using the Populate action about that grid.
Kindly check the To Extend an Existing Entity in the following help article, https://help.acumatica.com/(W(16))/Help?ScreenId=ShowWiki&pageid=c450492e-06fe-4563-95c3-efa76975415b
Also, I have attached the customization package with the extended endpoint. You can use it for testing and as reference, try using the JSON syntax from my previous comment. Good Luck,
I had to modify your project since a lot of items are not applicable to me. For example, in your project it expects the projectid to be an intvalue in the tasks, but I cannot find it. After some modifications, I am getting the following error
"exceptionMessage": "The system failed to commit the Tasks row.",
I have attached my project here. If you could spot something obvious, let me know. I am on build Build 23.112.0032
Hi
I published your project and made the following changes to your request. It seems to work fine.
{
"ProjectID": {
"value": "INTERNAL23"
},
"Tasks": [
{
"note": {
"value": "a task for a project"
},
"ActivityHistory": [],
"Default": {
"value": false
},
"Description": {
"value": "DESCRIPTION 1"
},
"ExternalRefNbr": {
"value": "140783"
},
"TaskID": {
"value": "CS-140783"
},
"Status": {
"value": "In Planning"
},
"TaskCategory": {
"value": "Products & Services"
}
},
{
"note": {
"value": "a task for a project"
},
"Default": {
"value": false
},
"Description": {
"value": "DESCRIPTION 2"
},
"ExternalRefNbr": {
"value": "140784"
},
"TaskID": {
"value": "CS-140784"
},
"Status": {
"value": "In Planning"
},
"TaskCategory": {
"value": "Products & Services"
}
}
]
}
Enter your username or e-mail address. We'll send you an e-mail with instructions to reset your password.