Reply
New Member
Posts: 41
Registered: ‎12-15-2016
Kudos: 4
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,740
Registered: ‎12-10-2015
Kudos: 1330
Solutions: 292

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,523
Registered: ‎05-19-2009
Kudos: 762
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?

New Member
Posts: 41
Registered: ‎12-15-2016
Kudos: 4

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,266
Registered: ‎03-21-2016
Kudos: 201
Solutions: 146

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,740
Registered: ‎12-10-2015
Kudos: 1330
Solutions: 292

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/

New Member
Posts: 41
Registered: ‎12-15-2016
Kudos: 4

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,740
Registered: ‎12-10-2015
Kudos: 1330
Solutions: 292

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: 30
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: 148
Registered: ‎04-03-2017
Kudos: 131

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,740
Registered: ‎12-10-2015
Kudos: 1330
Solutions: 292

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.
Reply