Hi Fusion Community,
I'd like to bulk remove/delete hours entries from a number of open billing records. It looks like I would need to use the DELETE method via an API module in Fusion. Is anyone willing to guide me through this?
Thanks!
Nick
Solved! Go to Solution.
Topics help categorize Community content and increase your ability to discover relevant content.
I think you have to use the Custom API Call module (at least, that's how we do it). Here's an example pipeline that gets to just the deletion portion. Note that it's simply about setting the hours value to an empty array.
Views
Replies
Total Likes
It's pretty straightforward. You can either use the Delete module or the Custom API module with a method of DELETE and a URL of bill/{id}. Just make sure the billing record first has no hours associated to it and it's not in "invoiced" status. So you may need to do some updates to the record PRIOR to the deletion itself.
Router
--> Change status to uninvoiced
--> Remove association to any hours
--> Delete the object
The removal of association to hours is the trickiest part, but it's just a bill/{id} update call where you set the hours to an empty array / null.
Views
Replies
Total Likes
Thanks for this, cverges-medallia.
The part I'm uncertain on how to create is the last part, the removal of association to hours and setting the hours to an empty array/null. Are you able to show a screenshot of how you would set up that module?
Views
Replies
Total Likes
I think you have to use the Custom API Call module (at least, that's how we do it). Here's an example pipeline that gets to just the deletion portion. Note that it's simply about setting the hours value to an empty array.
Views
Replies
Total Likes
Perfect, that worked! Thanks, cverges-medallia.
My goal with this is to remove certain hour records from billing records so I can then make some user cost rate updates, and the costs for those hours I pulled out of the billing records calculates at the correct rate.
Once I make the user cost rate updates, I want to re-add the hour records I removed from the billing record and put them back in the billing records. Do you know if the API method is best for that, and if so, are you able to provide some guidance again?
Views
Replies
Total Likes
Sure, it's the same, just in reverse and using a POST/PUT (depending on whether you're creating or updating):
{
"hours": [
"123",
"456",
"789",
...
]
}
where each of the entries in the array are the IDs of the hour object that you want associated to the billing record.
Views
Replies
Total Likes
Great, thanks.
Do I need to list the hour record ID's, like you did in the above example, if I have many billing records with many hour records, or is there some sort of relative reference that can be used in the API Body so I don't have to one billing record at a time and list all of the associated hour id's?
Views
Replies
Total Likes
There is perhaps a way to do it, but I would point you to Adobe PS and/or support for guidance on this. It uses an unpublished feature of the API and we had to receive special dispensation to use it. (Not saying we're special, just don't want to publicly go against Adobe's standard position on this.)
Views
Replies
Total Likes
Not a problem.
Thanks again for your help!
Views
Replies
Total Likes
Views
Likes
Replies
Views
Likes
Replies
Views
Likes
Replies