Method does not exist or incorrect signature

You are currently viewing Method does not exist or incorrect signature
handle method goes not exist or incorrect signature

In most of the cases Incorrect signature means you are passing invalid parameter to the method. In this blog we have discussed some common scenario of getting error – method does not exist or incorrect signature .

Scenario - 1

error – Method does not exist or incorrect signature: void emptyRecycleBin(Id) from the type Database
error – Method does not exist or incorrect signature: void emptyRecycleBin(String) from the type

Solution

Here you are trying to pass string or Id to the Database.emptyRecycleBin. Supported parameter for emptyRecycleBin are  

Sample Code​

				
					Database.emptyRecycleBin(Trigger.old); 
				
			
				
					Account con = new Account(Id = '0015j00000nSCGY');
Database.emptyRecycleBin(con);
				
			
				
					List<Account> deletedAcc = [SELECT Id from Account where isDeleted=true ALL ROWS];
Database.emptyRecycleBin(deletedAcc);
				
			

Here you can find official documentation for Database.emptyRecycleBin.

Leave a Reply