Skip to main content
Solved

Adding multiple project tasks in one call.


abhijit
Varsity I
Forum|alt.badge.img

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

Hi @abhijit 

I published your project and made the following changes to your request. It seems to work fine.

  1. Use TaskID instead of ProjectTaskID. It has been mapped as TaskID in your endpoint.

     

  2. Don’t send ProjectID in Tasks since it is not mapped in your endpoint (not needed anyway).
{
    "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"
            }
        }
    ]
}

 

View original
Did this topic help you find an answer to your question?

6 replies

Vignesh Ponnusamy
Acumatica Moderator
Forum|alt.badge.img+5

Hi @abhijit,

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,


abhijit
Varsity I
Forum|alt.badge.img
  • Author
  • 43 replies
  • January 24, 2024

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.

 


abhijit
Varsity I
Forum|alt.badge.img
  • Author
  • 43 replies
  • January 24, 2024

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"
			}
		}
	]
}

 

 


Vignesh Ponnusamy
Acumatica Moderator
Forum|alt.badge.img+5

Hi @abhijit,

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,  


abhijit
Varsity I
Forum|alt.badge.img
  • Author
  • 43 replies
  • January 25, 2024

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 


Forum|alt.badge.img+2
  • Acumatica Moderator
  • 59 replies
  • Answer
  • February 15, 2024

Hi @abhijit 

I published your project and made the following changes to your request. It seems to work fine.

  1. Use TaskID instead of ProjectTaskID. It has been mapped as TaskID in your endpoint.

     

  2. Don’t send ProjectID in Tasks since it is not mapped in your endpoint (not needed anyway).
{
    "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"
            }
        }
    ]
}

 


Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings