Skip to main content

Posts

Showing posts from April, 2023

Restrict Users to Use Salesforce Classic

Did you know you can restrict users to use Salesforce Classic, How? Below are the steps: 1) Select the Profile of the User. In my case I m using System Admin Profile. 2) Go to Setup --> In the Quick find box --> Search Profiles 3) Select the System Admin Profile. 4) Search for "Hide Option to Switch to Salesforce Classic" . Refer the Below Screeshot. After Enabling the "Hide Option to Switch to Salesforce Classic" for a particular profile, User cannot see the "Switch to Salesforce Classic" option in user profile.                                                                            Thank you !!!  

Login Salesforce Without Credentials(Without UserName and Password)

  Want to login into Salesforce without credentials. Please follow the below STEPS: STEPS:-  1)  Goto to setup  --> Open Developer Console. 2) Goto debug --> Open Execute Anonymous Window --> It will open the pop. 3) Please write the below code in Anonymous window.       String sessionId = UserInfo.getOrganizationId() + '' + UserInfo.getSessionId().SubString(15);      System.debug('$$$$ Session Id ' + sessionId); 4) Click on Execute and filter the debug. You can see one session Id with Organization Id. Now, we have to copy the debug session Id and create one login URL. Steps to create Login URL: 1) Copy the Salesforce URL. Please refer the screenshot shown below. 2) Now concatenate the session Id with the salesforce URL and your Session Id Will look like below. https://d5g000004zfq2eai-dev-ed.lightning.force.com/secur/frontdoor.jsp?sid=00D5g000004zfQ2EAI!AQgAQKzTcnQTifXpRnQ7DgECtk_rv.w9BT5FoPEAmoy_UrgG4HJ6B9YFpQ2LVlmnJhBrYPSf8cI...

Top 5 trigger scenarios in salesforce

  1)  Write a trigger on the Account when the Account is updated check all opportunities related to the account. Update all Opportunities Stage to close lost if an opportunity created date is greater than 30 days from today and stage not equal to close won. trigger UpdateOpportunitiesOnAccountUpdate on Account (after update) {          // Get the IDs of all the updated Accounts     Set<Id> accountIds = new Set<Id>();     for (Account acc : Trigger.new) {         accountIds.add(acc.Id);     }          // Query for all Opportunities related to the updated Accounts     List<Opportunity> opportunitiesToUpdate = [         SELECT Id, StageName, CreatedDate         FROM Opportunity         WHERE AccountId IN :accountIds     ];          // Update Opportunities that ...