You need to sign in to do that
Don't have an account?
Deanna Aaron 11
QueryAll and call update() - What does this mean?
Hi,
I am trying to unarchive a record in Salesforce. I found two solutions online, but I don't understand the steps to take in order to unarchive the record.
Solution #1 Source: https://salesforce.stackexchange.com/questions/70860/how-to-unarchive-activities
Use queryAll in the API to retrieve the activities, then perform an update to the records. You only need to call update() using just records by Id value (you just "touch" the record). They will be restored upon saving.
The Data Loader exposes queryAll as "Export All."
OR
Solution #2 Source: https://help.salesforce.com/articleView?id=000199524&type=1
1.) Use Workbench or use any tool and select the option include Deleted and Archived records,which could use queryAll() method. The queryAll() method needs a connection setup as it can only be used via an API call.
2.) ALL ROWS is only intended for use in Apex SOQL queries. The documentation for ALL ROWS is in the Apex code documentation. The equivalent of ALL ROWS in the API is to call queryAll() instead of query(). You can't use that in Developer Console's Query Editor as the query editor doesn't execute it as Apex Code,it executes directly as a REST query API call.
3.) Salesforce Support can increase the archive period for your ORG, to retrieve more archived records.
Can you show images in how to solve this?
QueryAll() -- Am i supposed to put something in the ()?
Update() -- Again, do I put something in the ()?
Thank you very much for your help. I can't uninstall a specific package until this is fixed.
I am trying to unarchive a record in Salesforce. I found two solutions online, but I don't understand the steps to take in order to unarchive the record.
Solution #1 Source: https://salesforce.stackexchange.com/questions/70860/how-to-unarchive-activities
Use queryAll in the API to retrieve the activities, then perform an update to the records. You only need to call update() using just records by Id value (you just "touch" the record). They will be restored upon saving.
The Data Loader exposes queryAll as "Export All."
OR
Solution #2 Source: https://help.salesforce.com/articleView?id=000199524&type=1
1.) Use Workbench or use any tool and select the option include Deleted and Archived records,which could use queryAll() method. The queryAll() method needs a connection setup as it can only be used via an API call.
2.) ALL ROWS is only intended for use in Apex SOQL queries. The documentation for ALL ROWS is in the Apex code documentation. The equivalent of ALL ROWS in the API is to call queryAll() instead of query(). You can't use that in Developer Console's Query Editor as the query editor doesn't execute it as Apex Code,it executes directly as a REST query API call.
3.) Salesforce Support can increase the archive period for your ORG, to retrieve more archived records.
Can you show images in how to solve this?
QueryAll() -- Am i supposed to put something in the ()?
Update() -- Again, do I put something in the ()?
Thank you very much for your help. I can't uninstall a specific package until this is fixed.
You can access Workbench here: https://workbench.developerforce.com/login.php.
Accept the terms of service and Login with your Salesforce credentials.
In "Jump to:", select SOQL Query and pick your object (I'm using Event for my example). Click "Select".
Under "Deleted and archived records:", select "Include". Pick the Id field and any other fields that will help you identify the record you are looking for. (This is a multi-select list box. Use Ctrl-Click on Windows or Command-Click on OSX to pick additional fields.) Add the filter "IsArchived = true", as shown. Click "Query".
You should get a list of query results, like this:
If you hover over the one you want, you will have the option to Update it. Hover and click "Update".
Continued in the next post...
All Answers
You can access Workbench here: https://workbench.developerforce.com/login.php.
Accept the terms of service and Login with your Salesforce credentials.
In "Jump to:", select SOQL Query and pick your object (I'm using Event for my example). Click "Select".
Under "Deleted and archived records:", select "Include". Pick the Id field and any other fields that will help you identify the record you are looking for. (This is a multi-select list box. Use Ctrl-Click on Windows or Command-Click on OSX to pick additional fields.) Add the filter "IsArchived = true", as shown. Click "Query".
You should get a list of query results, like this:
If you hover over the one you want, you will have the option to Update it. Hover and click "Update".
Continued in the next post...
If the update is successful, your record should no longer be archived.
Thank you, Glyn! You get mega karma points for taking the time to lay this out. Unfortunately, the object I am using "product2" doesn't have "IsArchived" as a dropdown :(
Thanks anyway!
Sorry for you predicament. Let me know if you find a solution. Have you opened a support ticket with Salesforce?