function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
deva mullapudideva mullapudi 

field IsDeleted does not support aggregate operator COUNT

Hi All,

Count(Field) is not working for few Data Types. is there any way to achive this ?
Stefan AbramiukStefan Abramiuk
Hi Deva,
please explain how do you want to use IsDeleted field with COUNT?
I thinkt that you've missuderstood this funcionality.
If you could put more light on it I may suggest you something.
 
List<Account> deletedAccList = [SELECT COUNT(Id) FROM Account WHERE IsDeleted = true ALL ROWS]

 
AshlekhAshlekh
Hi,

Can you please wirte you query so I can do some more info and will help you.

-thanks
Ashlekh Gera
deva mullapudideva mullapudi
select Count(Id),Count(IsDeleted),Count(MasterRecordId),Count(Name),Count(Type),Count(ParentId),Count(BillingStreet),Count(BillingCity),Count(BillingState),Count(BillingPostalCode),Count(BillingCountry),Count(BillingLatitude),Count(BillingLongitude),Count(BillingGeocodeAccuracy),Count(BillingAddress),Count(ShippingStreet),Count(ShippingCity),Count(ShippingState),Count(ShippingPostalCode),Count(ShippingCountry),Count(ShippingLatitude),Count(ShippingLongitude),Count(ShippingGeocodeAccuracy),Count(ShippingAddress),Count(Phone),Count(Fax),Count(AccountNumber),Count(Website),Count(PhotoUrl),Count(Sic),Count(Industry),Count(AnnualRevenue),Count(NumberOfEmployees),Count(Ownership),Count(TickerSymbol),Count(Description),Count(Rating),Count(Site),Count(OwnerId),Count(CreatedDate),Count(CreatedById),Count(LastModifiedDate),Count(LastModifiedById),Count(SystemModstamp),Count(LastActivityDate),Count(LastViewedDate),Count(LastReferencedDate),Count(Jigsaw),Count(JigsawCompanyId),Count(CleanStatus),Count(AccountSource),Count(DunsNumber),Count(Tradestyle),Count(NaicsCode),Count(NaicsDesc),Count(YearStarted),Count(SicDesc),Count(DandbCompanyId),Count(CustomerPriority__c),Count(SLA__c),Count(Active__c),Count(NumberofLocations__c),Count(UpsellOpportunity__c),Count(SLASerialNumber__c),Count(SLAExpirationDate__c) from Account


The above query throwing error
AshlekhAshlekh
Hi,

First thing -  IsDeleted does not support aggregate operator COUNT. It is a salesforce functionaltiy.

Second why you want to user IsDelete in Count function, Just user Id. It will give you same result.

-Thanks
Ashlekh Gera