Reply
Emerging Member
Posts: 53
Registered: ‎12-15-2016
Kudos: 5
Accepted Solution

Delete a lot of items - clients/invoices

Hello,

 

we would need to delete a lot of test clients and invoices .. how about it?

Other settings, like as Services, Custom Atributes, Keywords we need do keep it.

 

Thanks

A


Accepted Solutions
Ubiquiti Employee
Posts: 3,810
Registered: ‎12-10-2015
Kudos: 1345
Solutions: 295

Re: Delete a lot of items - clients/invoices

@adc use this:

(besides, you can also control the number of items shown on the page - see below the grid)

Selection_999(297).png

View solution in original post


All Replies
Veteran Member
Posts: 4,527
Registered: ‎05-19-2009
Kudos: 783
Solutions: 23

Re: Delete a lot of items - clients/invoices

did you tag your test clients are at least put test or something in the name?

Emerging Member
Posts: 53
Registered: ‎12-15-2016
Kudos: 5

Re: Delete a lot of items - clients/invoices

No .. we tried to import the real data from our existing database. And we still have to do it a few more times, apparently Man Wink 

Ubiquiti Employee
Posts: 1,325
Registered: ‎03-21-2016
Kudos: 214
Solutions: 150

Re: Delete a lot of items - clients/invoices

@adc If you are in sandbox mode, than you can use the sandbox mode termination feature, which handles exactly this. Just click the sandbox button in the left menu.

If you did not, you can activate it by going to your-domain.tld/wizard/lets-start and choosing to use sandbox mode. Then you can use the termination feature.

Or you can simply choose all your clients/invoices/payments in the list and delete them that way.

Ubiquiti Employee
Posts: 3,810
Registered: ‎12-10-2015
Kudos: 1345
Solutions: 295

Re: Delete a lot of items - clients/invoices

[ Edited ]

@adc by default, UCRM is started in the "demo mode". While terminating the demo mode, you can decide what to keep and what to delete.
Another option is to manually check the items you want to delete and click delete button - e.g. filter some clients in the clients grid and delete them/

Emerging Member
Posts: 53
Registered: ‎12-15-2016
Kudos: 5

Re: Delete a lot of items - clients/invoices

We are not in sandbox mode and no more than 20 clients can be tagged over the web :/

Ubiquiti Employee
Posts: 3,810
Registered: ‎12-10-2015
Kudos: 1345
Solutions: 295

Re: Delete a lot of items - clients/invoices

@adc use this:

(besides, you can also control the number of items shown on the page - see below the grid)

Selection_999(297).png

New Member
Posts: 35
Registered: ‎05-20-2008
Kudos: 9
Solutions: 1

Re: Delete a lot of items - clients/invoices

hello,

 

if someone will be interested in deleting all clients through API, we created a script for that:

 

// Get collection of all Clients.                                                                                                                                                       $logfile = 'ucrm-delete-clients-all.log';                                                                                                                                               $res = UcrmApiAccess::doRequest('clients?limit=5000') ?: [];                                                                                                                                                                                                                                       
$clients = $res['response'];                                                                                                                                                            
echo sprintf('Found %d clients.', count($clients)) . PHP_EOL;                                                                                                                           
foreach ($clients as $client) {                                                                                                                                                         
    $cid = $client['id'];                                                                                                                                                               
    $ident = $client['userIdent'];                                                                                                                                                      
    $name = trim($client['companyName'].' '.$client['firstName'].' '.$client['lastName'].' ');                                                                                          
    // delete client                                                                                                                                                                    
    $res = UcrmApiAccess::doRequest(                                                                                                                                                    
        sprintf('clients/%d', $cid),                                                                                                                                                    
            'DELETE'                                                                                                                                                                    
    );                                                                                                                                                                                  
    if ($res['code'] == 200) {                                                                                                                                                          
        $logmsg = "OK deleted client cid=[$cid] ident=[$ident] name=[$name]";                                                                                                           
    } else {                                                                                                                                                                            
        $logmsg = "ERR deleting client cid=[$cid] ident=[$ident] name=[$name] code=[".$res['code']."] response=[".$res['response']."]";                                                 
    }                                                                                                                                                                                   
    // write to logfile                                                                                                                                                                    
    $time = time();                                                                                                                                                                     
    $logdate = date("Ymd-His",$time);                                                                                                                                                   
    print "$logdate $logmsg\n";                                                                                                                                                         
    $fp = fopen($logfile,"a+");                                                                                                                                                         
    fwrite($fp,"$logdate $logmsg\n");                                                                                                                                                   
    fclose($fp);                                                                                                                                                                        
}
Member
Posts: 155
Registered: ‎04-03-2017
Kudos: 136

Re: Delete a lot of items - clients/invoices

Can we get a list view of tickets PLEASE with bulk check box delete option.  I'm getting a lot of returned mail messages, and some messages when you scroll down thru the list, after you delete stays at your place in the list, but when you delete mail returned tickets, it puts you back up to the top and you lose your place.

also, PLEASE, PLEASE, PLEASE, can we get an overview of how many tickets are in open / pending status, also, also add the ability to add custom ticket status and custom job status please, please, please. lol

Ubiquiti Employee
Posts: 3,810
Registered: ‎12-10-2015
Kudos: 1345
Solutions: 295

Re: Delete a lot of items - clients/invoices

@HyperFusion this sounds reasonable, we will add this to our scope of future development. You can increase the priority of these tasks if you create a feature request which gets as many votes as possible.
Member
Posts: 180
Registered: ‎10-30-2013
Kudos: 103
Solutions: 2

Re: Delete a lot of items - clients/invoices

It looks as if you need to select the ones you want to delete (or use that select all) then select Archive (delete isn't available to me on 2.14.7). Once those records are arvived, then you can select them again and delete. Currently appears to be a 2-step delete process.

Highlighted
Ubiquiti Employee
Posts: 3,810
Registered: ‎12-10-2015
Kudos: 1345
Solutions: 295

Re: Delete a lot of items - clients/invoices

yes, deleting of an active client is 2-step process via the archive. We believe that mostly you want to keep a record of a previous client instead of erasing them at all. If you often need to delete an active client permanently (without archiving), please let us know + feel free to create a new feature request.
Reply