<?xml version="1.0" encoding="UTF-8"?><rss
version="2.0"
xmlns:content="http://purl.org/rss/1.0/modules/content/"
xmlns:wfw="http://wellformedweb.org/CommentAPI/"
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:atom="http://www.w3.org/2005/Atom"
xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
><channel><title>Salesforce Admin Hacks | Taha Syed | Salesforce</title>
<atom:link href="https://www.syedtaha.com/category/salesforce-admin-hacks/feed/" rel="self" type="application/rss+xml" /><link>https://www.syedtaha.com</link>
<description>Taha Syed &#124; Sales to Salesforce &#124; Dissecting and Defining the Rationale..</description>
<lastBuildDate>Wed, 10 Oct 2018 19:41:32 +0000</lastBuildDate>
<language>en-US</language>
<sy:updatePeriod>
hourly	</sy:updatePeriod>
<sy:updateFrequency>
1	</sy:updateFrequency>
<generator>https://wordpress.org/?v=6.9.4</generator>
<item><title>Convert Salesforce ID from 15 to 18 Characters</title><link>https://www.syedtaha.com/salesforce-admin-hacks/convert-salesforce-id-from-15-to-18-characters/1026/</link>
<comments>https://www.syedtaha.com/salesforce-admin-hacks/convert-salesforce-id-from-15-to-18-characters/1026/#respond</comments>
<dc:creator><![CDATA[Taha Syed]]></dc:creator>
<pubDate>Wed, 10 Oct 2018 19:13:33 +0000</pubDate>
<category><![CDATA[Salesforce Admin Hacks]]></category>
<category><![CDATA[convert salesforce id]]></category>
<category><![CDATA[salesforce id]]></category>
<guid
isPermaLink="false">http://www.syedtaha.com/?p=1026</guid><description><![CDATA[<p>Enter the 15 character Salesforce Ids in the first text box (one per line) and click on the convert button to get the 18 character Salesforce Ids.</p>
The post <a
href="https://www.syedtaha.com/salesforce-admin-hacks/convert-salesforce-id-from-15-to-18-characters/1026/">Convert Salesforce ID from 15 to 18 Characters</a> first appeared on <a
href="https://www.syedtaha.com">Taha Syed | Salesforce</a>.]]></description>
<content:encoded><![CDATA[<h1><strong>Convert the 15 character Salesforce Id&#8217;s to 18 characters.</strong></h1><p>Here is a simple tool that converts the Salesforce 15 character Ids to 18 character Ids.</p><p>This conversion of Salesforce ids from 15 character to 18 characters is done on the local machine and is safe to use.The Salesforce 15 to 18 char Id conversion tool calls Javascript from the footer of the page hence transmits no data to the server.</p><p>Enter the 15 character Salesforce Ids in the input text box (one per line) and click on the convert button to get the 18 character Salesforce Ids.</p><p>&nbsp;<br
/>
<strong>Input 15 character Salesforce Ids &#8211; one per line</strong><br
/><textarea id="inputConvertedSalesforce15to18Ids" style="height: 90%; min-height: 200px; width: 600px;"></textarea><br
/>
&nbsp;<br
/>
<button
onclick="ConvertSalesforce15to18()">Click to Convert Salesforce 15 digit Ids tp 18 digits</button><br
/>
&nbsp;<br
/>
<strong>Output: 18 character Salesforce Ids</strong><br
/><textarea id="displayConvertedSalesforce15to18Ids" style="height:90%;min-height:200px;width:600px"></textarea></p>The post <a
href="https://www.syedtaha.com/salesforce-admin-hacks/convert-salesforce-id-from-15-to-18-characters/1026/">Convert Salesforce ID from 15 to 18 Characters</a> first appeared on <a
href="https://www.syedtaha.com">Taha Syed | Salesforce</a>.]]></content:encoded>
<wfw:commentRss>https://www.syedtaha.com/salesforce-admin-hacks/convert-salesforce-id-from-15-to-18-characters/1026/feed/</wfw:commentRss>
<slash:comments>0</slash:comments>
</item>
<item><title>Manually Setup a Users Password in Salesforce</title><link>https://www.syedtaha.com/salesforce-admin-hacks/manually-setup-a-users-password-in-salesforce/1001/</link>
<comments>https://www.syedtaha.com/salesforce-admin-hacks/manually-setup-a-users-password-in-salesforce/1001/#comments</comments>
<dc:creator><![CDATA[Taha Syed]]></dc:creator>
<pubDate>Fri, 17 Aug 2018 17:14:07 +0000</pubDate>
<category><![CDATA[Salesforce Admin Hacks]]></category>
<category><![CDATA[admin hacks]]></category>
<category><![CDATA[developer console]]></category>
<category><![CDATA[password]]></category>
<category><![CDATA[salesforce]]></category>
<category><![CDATA[setup password manually]]></category>
<category><![CDATA[system.setpassword]]></category>
<category><![CDATA[user]]></category>
<category><![CDATA[users password]]></category>
<category><![CDATA[workbench]]></category>
<guid
isPermaLink="false">http://www.syedtaha.com/?p=1001</guid><description><![CDATA[<p>Manually Setup a Users Password in Salesforce using the Developer Console or the Workbench. Here's a step by step method to setup the users password manually. Pro tip includes creating a user interface to setup new passwords manually.</p>
The post <a
href="https://www.syedtaha.com/salesforce-admin-hacks/manually-setup-a-users-password-in-salesforce/1001/">Manually Setup a Users Password in Salesforce</a> first appeared on <a
href="https://www.syedtaha.com">Taha Syed | Salesforce</a>.]]></description>
<content:encoded><![CDATA[<h1>Manually Setup a User&#8217;s Password in Salesforce using Developer Console or the Workbench.</h1><p>There are times when an Administrator needs to <strong>manually setup a users password in Salesforce. </strong>Salesforce Administrator&#8217;s can <strong>reset</strong> a User&#8217;s password from the User record detail page but Salesforce user interface doesn&#8217;t allow an Administrator to setup a specific password. Here is an Awesome Admin Hack to achieved this using the Developer Console or the Workbench.</p><p>Let&#8217;s discuss each method step by step.</p><h2>Manually Setup a User&#8217;s Password in Salesforce Using the Developer Console.</h2><p>Step 1. Get the User&#8217;s Id from the URL bar on the User&#8217;s record detail page.</p><figure
id="attachment_1002" aria-describedby="caption-attachment-1002" style="width: 674px" class="wp-caption alignnone"><img
fetchpriority="high" decoding="async" class="size-full wp-image-1002" src="http://www.syedtaha.com/wp-content/uploads/2018/08/get-Salesforce-User-ID.png" alt="get Salesforce User ID" width="674" height="328" srcset="https://www.syedtaha.com/wp-content/uploads/2018/08/get-Salesforce-User-ID.png 674w, https://www.syedtaha.com/wp-content/uploads/2018/08/get-Salesforce-User-ID-300x146.png 300w" sizes="(max-width: 674px) 100vw, 674px" /><figcaption
id="caption-attachment-1002" class="wp-caption-text">get Salesforce User ID</figcaption></figure><p>Step 2. Open Developer Console</p><p>Step 3. Open the Execute Anonymous Window from Debug &gt;&gt; Open Execute Anonymous Window OR using the shortcut Ctrl + E</p><p>Step 4. Enter the following Apex code. Replace the UserId and Password with the actual values we need.</p><pre class="lang:default decode:true ">System.SetPassword('UserId','Password'); //Replace the UserId and Password</pre><p>Step 5. Click Execute</p><p>We successfully manually setup the User&#8217;s password using the developer console and an email with the new security token will is emailed to the User.</p><p>&nbsp;</p><h2>Manually Setup a User&#8217;s Password in Salesforce Using Workbench.</h2><ol><li>Visit <a
href="https://workbench.developerforce.com/login.php" target="_blank" rel="noopener">Workbench</a> (<a
href="https://workbench.developerforce.com/login.php" target="_blank" rel="noopener">https://workbench.developerforce.com/login.php</a>) and Login using your Salesforce credentials.</li><li>Navigate to Utilities &gt;&gt; <a
href="https://workbench.developerforce.com/pwdMgmt.php" target="_blank" rel="noopener">Password Management</a></li><li>Enter the User&#8217;s Id and the New Password</li><li>Click on Change Password</li></ol><p>We successfully manually setup the User&#8217;s password using Workbench and an email with the new security token will is emailed to the User.</p><p>&nbsp;</p><h2>Pro Tip: Creating a User Interface to manually setup a User&#8217;s password in Salesforce.</h2><p>Step 1. Create a New Text Field on the User Object and Name it Password__c</p><p>Step 2. Create the following trigger on the User object</p><pre class="lang:default decode:true ">trigger setPassword on User (before update) {
    for (User u:Trigger.New) {
        User oldUser = Trigger.OldMap.get(u.id);
        If ((u.Password__c != null) &amp;&amp; (oldUser.Password__c != u.Password__c)) {
            System.SetPassword(u.id,u.password__c);
            //Uncomment below line to clear password field
            //u.Password__c = null;
        }    
    }
}</pre><p>Note: Use validation rules on Password__c to only accept passwords that align with your organization&#8217;s password policies.</p><p>Here&#8217;s how the trigger looks in the developer console (image)</p><figure
id="attachment_1020" aria-describedby="caption-attachment-1020" style="width: 945px" class="wp-caption alignnone"><img
decoding="async" class="wp-image-1020 size-full" src="http://www.syedtaha.com/wp-content/uploads/2018/08/manually-setup-a-users-password-in-Salesforce.png" alt="manually setup a users password in Salesforce" width="945" height="449" srcset="https://www.syedtaha.com/wp-content/uploads/2018/08/manually-setup-a-users-password-in-Salesforce.png 945w, https://www.syedtaha.com/wp-content/uploads/2018/08/manually-setup-a-users-password-in-Salesforce-300x143.png 300w, https://www.syedtaha.com/wp-content/uploads/2018/08/manually-setup-a-users-password-in-Salesforce-768x365.png 768w" sizes="(max-width: 945px) 100vw, 945px" /><figcaption
id="caption-attachment-1020" class="wp-caption-text">Manually setup a users password in Salesforce</figcaption></figure><p>Step 3. Now visit the User&#8217;s record detail page and enter the new password in the <strong>Password</strong> field that we created and click Save.</p><p>The User&#8217;s password will be changed and an email with the new security token will be emailed to the User.</p><p>&nbsp;</p><p>Update: To send the new password to the user by email, the trigger will be:</p><pre class="lang:default decode:true ">trigger CPTsetPassword on User (before update) {
    List &lt;String&gt; toAddresses = New List &lt;String&gt;();
    for (User u:Trigger.New) {
        User oldUser = Trigger.OldMap.get(u.id);
        If ((u.Password__c != null) &amp;&amp; (oldUser.Password__c != u.Password__c)) {
            System.SetPassword(u.id,u.password__c);
            toAddresses.add(u.Email);
            //Uncomment below line to clear password field after reset
            //u.Password__c = null;   
            
            //Sending the users new password by email
            Messaging.SingleEmailMessage mail = new Messaging.SingleEmailMessage();
            mail.setToAddresses(toAddresses);
            mail.setSubject('Salesforce Password Reset');
            mail.setPlaintextBody('Your password was reset by the Administrator and the new Password is ' + u.Password__c);
            Messaging.sendEmail(new Messaging.SingleEmailMessage[] {mail});         
        }    
    } 
}</pre><p>&nbsp;</p>The post <a
href="https://www.syedtaha.com/salesforce-admin-hacks/manually-setup-a-users-password-in-salesforce/1001/">Manually Setup a Users Password in Salesforce</a> first appeared on <a
href="https://www.syedtaha.com">Taha Syed | Salesforce</a>.]]></content:encoded>
<wfw:commentRss>https://www.syedtaha.com/salesforce-admin-hacks/manually-setup-a-users-password-in-salesforce/1001/feed/</wfw:commentRss>
<slash:comments>2</slash:comments>
</item>
<item><title>Changing Default Event Reminders in Users Settings For Multiple Users</title><link>https://www.syedtaha.com/salesforce-admin-hacks/changing-default-event-reminders-in-users-settings-for-multiple-users/983/</link>
<comments>https://www.syedtaha.com/salesforce-admin-hacks/changing-default-event-reminders-in-users-settings-for-multiple-users/983/#respond</comments>
<dc:creator><![CDATA[Taha Syed]]></dc:creator>
<pubDate>Thu, 16 Aug 2018 15:01:49 +0000</pubDate>
<category><![CDATA[Salesforce Admin Hacks]]></category>
<category><![CDATA[admin hacks]]></category>
<category><![CDATA[apex code]]></category>
<category><![CDATA[Set default event reminders to]]></category>
<category><![CDATA[user settings]]></category>
<guid
isPermaLink="false">http://www.syedtaha.com/?p=983</guid><description><![CDATA[<p>Updating the &#8220;Set default event reminders to&#8221; or any other User Setting for multiple Users. &#160; Scenario: While creating an Event or Task in Salesforce, the “Reminder” Checkbox is checked by default for all users. The reminders have piled up and making it difficult to keep track of the important events and tasks. The Sales [&#8230;]</p>
The post <a
href="https://www.syedtaha.com/salesforce-admin-hacks/changing-default-event-reminders-in-users-settings-for-multiple-users/983/">Changing Default Event Reminders in Users Settings For Multiple Users</a> first appeared on <a
href="https://www.syedtaha.com">Taha Syed | Salesforce</a>.]]></description>
<content:encoded><![CDATA[<h1>Updating the &#8220;Set default event reminders to&#8221; or any other User Setting for multiple Users.</h1><p>&nbsp;</p><h2>Scenario:</h2><p>While creating an Event or Task in Salesforce, the “Reminder” Checkbox is checked by default for all users. The reminders have piled up and making it difficult to keep track of the important events and tasks. The Sales team wants you to uncheck the “Set default event reminders to” Checkbox for all users.</p><p>This setting is found in:<br
/>
My Settings &gt;&gt; Calendar and Reminders &gt;&gt; Activity Reminders &gt;&gt; ‘Set default event reminders to’</p><figure
id="attachment_984" aria-describedby="caption-attachment-984" style="width: 455px" class="wp-caption alignnone"><img
decoding="async" class="wp-image-984 size-full" src="http://www.syedtaha.com/wp-content/uploads/2018/08/Activity-Reminders-Salesforce.png" alt="Activity Reminders Salesforce" width="455" height="381" srcset="https://www.syedtaha.com/wp-content/uploads/2018/08/Activity-Reminders-Salesforce.png 455w, https://www.syedtaha.com/wp-content/uploads/2018/08/Activity-Reminders-Salesforce-300x251.png 300w, https://www.syedtaha.com/wp-content/uploads/2018/08/Activity-Reminders-Salesforce-70x60.png 70w" sizes="(max-width: 455px) 100vw, 455px" /><figcaption
id="caption-attachment-984" class="wp-caption-text">Activity Reminders Salesforce</figcaption></figure><figure
id="attachment_985" aria-describedby="caption-attachment-985" style="width: 866px" class="wp-caption alignnone"><img
loading="lazy" decoding="async" class="wp-image-985 size-full" src="http://www.syedtaha.com/wp-content/uploads/2018/08/Activity-Reminder-Settings-Salesforce.png" alt="Activity Reminder Settings Salesforce" width="866" height="601" srcset="https://www.syedtaha.com/wp-content/uploads/2018/08/Activity-Reminder-Settings-Salesforce.png 866w, https://www.syedtaha.com/wp-content/uploads/2018/08/Activity-Reminder-Settings-Salesforce-300x208.png 300w, https://www.syedtaha.com/wp-content/uploads/2018/08/Activity-Reminder-Settings-Salesforce-768x533.png 768w" sizes="auto, (max-width: 866px) 100vw, 866px" /><figcaption
id="caption-attachment-985" class="wp-caption-text">Activity Reminder Settings Salesforce</figcaption></figure><p>&nbsp;</p><h2>Solution:</h2><p>This can be achieved by updating the User Object using Apex Code or the Data Loader</p><h2><span
style="text-decoration: underline;">Executing Apex Code Method</span></h2><p>A simple Apex code snipped can help us in unchecking “Set default event reminders to” Checkbox for multiple users. We will be using the Developer Console’s Execute Anonymous Window to run the Apex code.</p><p>To “Set default event reminders to” Checkbox to Unchecked, our Apex code will perform the following steps:</p><ol><li>Step 1: Create a List to hold Users that need an update to their settings.</li><li>Step 2: Find all Active Users whose ‘Activity Reminder Checkbox’ is ‘Checked’ and add them to the above list.</li><li>Step 3: Iterate through each user in the above list and Uncheck the Activity Reminder Checkbox</li><li>Step 4: Create a final list to update to reduce the DML statements</li></ol><div
class="tab_widget wp_shortcodes_tabs"><ul
class="wps_tabs"><li><a
href="#" data-tab="tab-0-step-1">Step 1</a></li><li><a
href="#" data-tab="tab-1-step-2">Step 2</a></li><li><a
href="#" data-tab="tab-2-step-3">Step 3</a></li><li><a
href="#" data-tab="tab-3-step-4">Step 4</a></li></ul><div
class="tab_container"><div
id="tab-0-step-1" class="tab_content clearfix"></p><p>We will create a List of Users</p><pre class="lang:default decode:true">// Create a list of Users whose setting needs to be changed
List &lt;User&gt; userList = New List &lt;User&gt;();</pre><p>&nbsp;</p><p></div><div
id="tab-1-step-2" class="tab_content clearfix"></p><p>We then write an SOQL to fetch all the users whose settings have to be changed.</p><pre class="lang:default decode:true ">//SOQL to add all users to the above list
userList = [
    SELECT Id, UserPreferencesEventRemindersCheckboxDefault
    FROM User
    WHERE UserPreferencesEventRemindersCheckboxDefault = True AND ISACTIVE = True];</pre><p>&nbsp;</p><p></div><div
id="tab-2-step-3" class="tab_content clearfix"></p><p>In this step, we will iterate through each user and change the required settings. Refer to the developer guide to know more about the settings. We will also add the users to the final list to be updated.</p><pre class="lang:default decode:true ">// Iterate through each user and update the setting
For (User u:userList) {
    u.UserPreferencesEventRemindersCheckboxDefault = False;
    userList2update.add(u);  //Add user to the final list to update
}</pre><p>&nbsp;</p><p></div><div
id="tab-3-step-4" class="tab_content clearfix"></p><p>As a best practice to reduce the DML statements, we will add the User to another list named ‘userList2Update’. Then, update all the Users in this list together using DML.</p><pre class="lang:default decode:true ">//Create a final list of Users to perform DML
List &lt;User&gt; userList2Update = New List &lt;User&gt;();


update userList2Update;  //Update the final List</pre><p>&nbsp;</p><p></div></div></div><div
class="clear"></div><p>Here&#8217;s the complete code to uncheck the &#8220;Set Default Reminders to&#8221; or any other user setting in Salesforce.</p><pre class="lang:default decode:true">//Create a final list of Users to perform DML
List &lt;User&gt; userList2Update = New List &lt;User&gt;();
// Create a list of Users whose setting needs to be changed
List &lt;User&gt; userList = New List &lt;User&gt;();

//SOQL to add all users to the above list
userList = [
    SELECT Id, UserPreferencesEventRemindersCheckboxDefault
    FROM User
    WHERE UserPreferencesEventRemindersCheckboxDefault = True AND ISACTIVE = True];

// Iterate through each user and update the setting
For (User u:userList) {
    u.UserPreferencesEventRemindersCheckboxDefault = False;
    userList2update.add(u);  //Add user to the final list to update
}

update userList2Update;  //Update the final List</pre><p>&nbsp;</p><p>Now that we have the Apex Code, lets head to the Developer Console and execute this code from the Anonymous Window (Ctrl + E)</p><p>&nbsp;</p><p>For the Data Loader method, please visit the Salesforce Help Article<br
/>
<a
href="https://help.salesforce.com/articleView?id=000004609&amp;language=en_US&amp;type=1" target="_blank" rel="noopener">https://help.salesforce.com/articleView?id=000004609&amp;language=en_US&amp;type=1</a></p><p>For a complete list of fields on the User Object, please visit the Developer Guide<br
/>
<a
href="https://developer.salesforce.com/docs/atlas.en-us.api.meta/api/sforce_api_objects_user.htm" target="_blank" rel="noopener">https://developer.salesforce.com/docs/atlas.en-us.api.meta/api/sforce_api_objects_user.htm</a></p>The post <a
href="https://www.syedtaha.com/salesforce-admin-hacks/changing-default-event-reminders-in-users-settings-for-multiple-users/983/">Changing Default Event Reminders in Users Settings For Multiple Users</a> first appeared on <a
href="https://www.syedtaha.com">Taha Syed | Salesforce</a>.]]></content:encoded>
<wfw:commentRss>https://www.syedtaha.com/salesforce-admin-hacks/changing-default-event-reminders-in-users-settings-for-multiple-users/983/feed/</wfw:commentRss>
<slash:comments>0</slash:comments>
</item>
</channel>
</rss>