You need to sign in to do that
Don't have an account?
Question about "ALL ROWS" in SOQL
Hi there
It seems to me that the "ALL ROWS" keyword that you use in SOQL (to access records in the recycled bin) can only be used in Apex.
I went to Developer Console in the Query Editor and tried typing this
SELECT ID FROM Fruit__c
and it executes.
But If I add "ALL ROWS" at the end, i.e.
SELECT ID FROM Fruit__c ALL ROWS
then I got
"Unknown error parsing query" error.
If I write this in an Apex code, like this
List<Fruit__c> fruits = [SELECT ID FROM Fruit__c ALL ROWS];
then the line actually executes successfully.
It seems weird to me that "ALL ROWS" keyword cannot be used inside the Query Editor. Wondering if anyone has encountered that?
Thanks
King
HI,
SOQL statements can use the ALL ROWS keywords to query all records in an organization, including deleted records and archived activities.
For example:
[SELECT COUNT() FROM Contact WHERE AccountId = a.Id ALL ROWS]);
You can use ALL ROWS to query records in your organization's Recycle Bin. You cannot use the ALL ROWS keywords with the FOR UPDATE keywords.
and if you have any more questions please feel to contact me on support@groundwireconsulting.com
My requirement is to now the deleted records using query
Added Idea for allowing ALL ROWS in Developer Console: https://success.salesforce.com/ideaView?id=08730000000DpgiAAC
1. Open "Enter Apex Code" window by selecting "Debug" -> "Open Execute Anonymous Window" menu
2. Enter your query there and output the result to the log. Check the "Open Log" checkbox.
List<Fruit__c> fruits = [SELECT ID FROM Fruit__c ALL ROWS];
System.debug(JSON.serialize(fruits);
3. Click "Execute" to run your code and check the log file for your result.
this one is working in query editer...
"just in you"'s workaround works
integer iCount = 0;
event[] queriedObjects =
[SELECT Id,isarchived,activitydate,subject from Event where (activitydate = 2017-01-04 and isarchived = true and isdeleted = false) ALL ROWS];
for (event e : queriedObjects) {
iCount = iCount + 1;
system.debug('event = '+e.isarchived + '--' + e.activitydate + '--' + e.subject);
}//next
system.debug('final count = '+iCount);
Po 4 długich latach, związek Tessy i Hardina zostaje w końcu wystawiony na próbę. Kiedy na jaw wychodzą mroczne rodzinne sekrety, okazuje się, że najtrudniejsza próba ze wszystkich jest jeszcze przed nimi. Czy uda im się znaleźć sposób, by wybaczyć sobie nawzajem i ruszyć dalej? A może ich miłość zostanie zniszczona przez ujawnione rewelacje?
https://after-4-recenzja-filmu.jimdosite.com/
https://gdzie-obejrzec-caly-film-listy-do-m-5-cda.jimdosite.com/ https://issuu.com/listy-do-m-5
https://issuu.com/listy-do-m-5