Posts

Showing posts from 2018

Set Default Lightning Experience for users

Image
Requirement: Set Default Lighting Experience for the User based on Profile Solution: Using  Visual flow and Login flow you can achieve the solution 1) Visual Flows 2) Login Flows Step 1 : Set Up>> Flow>> New Flows Create the Variables 1) User Id 2) User Name Click on " Resources Tab " and then Double Click on Variable and fill detail as mention in snapshot Step 2 : Click on " Palette Tab " and then select the record Lookup and fill mention detail as mention below Step 3 :  This is the main step, On User object there is a standrad field UserPreferencesLightningExperiencePreferred  which one track the user is in Lightning or Classic.Setting this field to true will force the Lightning UI. And setting its value to false will force the Classic mode. Click on " Palette Tab " and then select the record Update and mention detail as mention below Step 4: Select the Screen and display the Message, T

Roll up Amount from Child Object To Parent Object in Case of Lookup Relationship

Case : Roll up the values from Child to Parent Object in Case of Lookup Relationship. On Child Object (ChildObjectApiName__c) there is custom field Amount__c On Parent Object(ParentObjectApiName__c) there is a custom Field TotalChildAmount__c On Child Object relation ship of Parent Object is ParentObjectRealtionShipApiName__c Trigger triggerName on ChildObjectApiName__c(aftet insert, after delete, after update, after undelete) { set<id> setofParentObjectID = new set<id>(); // Storing the parent object Ids map<Id, ParentObjectApiName__c> mapofParentObjectIdToParnetObject  = new Map<Id, ParentObjectApiName__c>(); // Map is used for Storing the Parent Record Id to Parent Object if(Trigger.isInsert || Trigger.isUpdate || Trigger.isUndelete) { for(ChildObjectApiName__c objChildObject1: trigger.new) { if(objChildObject1.ParentObjectRealtionShipApiName__c != null) { setofParentObjectID.add(objChildObject1.ParentObjectRealtionShip