Attempting to deactivate account / department

I'm using the TeamDynamix c# API for imports and one of my tasks is to deactivate a department.  There is an api.CreateAccount function and an api.UpdateAccount function in the c# code, but both are acting like they're trying to create.  They both give a bad request result when the account name is the same as one that already exists.  I need to set  acct.IsActive to false but even the api.UpdateAccount function results with a account already exists message when I debug the response object. I'm being prevented from being able to deactivate an existing account or assign the value of acct.IsActive = false and have it be saved.  It seems accounts are keyed on the acct.Name field and the api.UpdateAccount function is really a create function and not an update function.

 

How do I deactivate an account ?

 

Thank you

Asked by Kirk McCoskey on Tue 4/12/22 12:45 PM Last edited Tue 4/12/22 12:52 PM
Sign In to leave feedback or contribute an answer

Answer (1)

This answer has been marked as the accepted answer
Mark Sayers Tue 4/12/22 2:13 PM

Hello Kirk,

I'll have to check into this for you. But it might not be possible to deactivate them via an API call, and instead you'd have to go into TDAdmin > Organization Settings > Accts/Depts to find and deactivate the desired Account.

Sincerely,
Mark Sayers
Sr Support Consultant, CS

No feedback
Hello Mark, I need to have the accounts / departments be updatable through some sort of automated process in TeamDynamix so that when an account is no longer active I can automatically update that account status in TeamDynamix. There has to be a way to do this. - Kirk McCoskey Fri 5/20/22 1:01 PM
The endpoint for editing an acct/dept via the PUT call does for sure allow you to deactivate an acct/dept. If you have multiple Accts/Depts of the same name though it will fail. - Mark Sayers Fri 5/20/22 3:04 PM
I was able to test and complete an update. I updated name, code, and a couple of other items. in the api c# code there is a GetAllActiveAccounts() method so I copied and modified it to GetAllInActiveAccounts(), but the default load doesn't pickup the deactivated accounts. I know this because in my test where I updated the name and code, I was also able to make the account deactivated. I refreshed the list from TeamDynamix and my account was hidden and my total list went from 282 to 281 that I could see, but the account that is deactivated doesn't show up. how can I see that deactivated account in the c# api code ? - Kirk McCoskey Fri 5/20/22 5:42 PM
The API results only return active Accts/Depts that the user a member of, unless that user has the "View All Accounts/Departments" permission, but this still restricts to only active Accts/Depts. - Mark Sayers Mon 5/23/22 9:12 AM