Skip to main content

Delete all debug logs

Evgenii Azimzhanov
Evgenii Azimzhanov

Mac/Linux only. Sets a debug log for 12 hours for a specific user

Installation:​

  1. Add the script to .bash_profile
  2. Reload your bash profile by running source ~/.bash_profile

Set the Debug Logs for a user

Evgenii Azimzhanov
Evgenii Azimzhanov

Sets a debug log for 12 hours for a specific user

Usage:​

log_dev.sh [-o arg] [-u arg] -z -h
-o target org to set debug log
-u Name of an entity to set debug log

Reset User after sandbox refresh

Evgenii Azimzhanov
Evgenii Azimzhanov

Usage examples

// reset a user that contains name
resetUserAfterRefreshByName('Evgenii Azimzhanov');
resetUserAfterRefreshByName('Evgenii Azi');
resetUserAfterRefreshByName('Azi');

// reset a user by id
resetUserAfterRefreshById('0054M000003QHQNQA4');

Last Viewed Records

Artem Kniazev
Artem Kniazev
SELECT Id FROM Whatever__c ORDER BY LastViewedDate DESC

And you can as well mark record (trigger LastViewedDate to be updated) with FOR VIEW operator

SELECT Id FROM Whatever__c ... FOR VIEW

Single Currency Formatting

Artem Kniazev
Artem Kniazev

How to format currency strings on orgs where multi-currency is not enabled No multi-currency means that there is no CurrencyIsoCode field available
You still can do currency formatting right in the SOQL

Opportunity o = [SELECT FORMAT(Amount) AmountFormatted, Amount FROM Opportunity LIMIT 1];
System.debug(o.get('AmountFormatted')); // 1 200,00$
System.debug(o.Amount); // 1200.00

Use FORMAT with the SELECT clause to apply localized formatting to standard and custom number, date, time, and currency fields. https://developer.salesforce.com/docs/atlas.en-us.soql_sosl.meta/soql_sosl/sforce_api_calls_soql_select_format.htm