Apex Trigger Practice (5) – Rollup Amount from Opportunity to Account

COMPONENTS On Standard Object – Account, there are following fields Total Revenue (Total_Revenue__c) (Number (16,2)) On standard Object Opportunity, which is child of Account Object, there are following fields StageName: Having value “Closed Won” Type: Having values Renewal, Upsell, New Business RenewalAmount__c : (Number (16,2)) UpsellAmount__c : (Number (16,2)) NewBusiness__c : (Number (16,2)) REQUIREMENT For …

Apex Trigger Practice (5) – Rollup Amount from Opportunity to Account Read More »

Custom Live Chat Using Salesforce Live Chat REST API

PREFACE We may choose to build a custom live chat app using Salesforce Live Chat REST API. There may be below given reasons or any specific reasons: Custom Experience:- Header, Footer, Navigation, Offline Form, Pre-chat Form Security Reason:- Salesforce generated embedded service snippet code does not require authentication and works publicly. Also, the script may …

Custom Live Chat Using Salesforce Live Chat REST API Read More »

How to get IP Address of Community User – Guest and Logged in Customer User

DESCRIPTION Tracing IP address of community is utmost requirement to achieve different goals like geo based technical support, spam protection and other security things. There are bunch of forum discussions related to this: https://developer.salesforce.com/forums/?id=9062I000000g56rQAA https://salesforce.stackexchange.com/questions/145145/how-to-get-ip-address-of-current-user-in-lightning-component https://salesforce.stackexchange.com/questions/246085/how-to-get-the-public-ip-address-of-current-user-in-lightning-component-hosted-o/246087 APPROACHES In order to solve this, simple approach is to get the IP address and store in any custom …

How to get IP Address of Community User – Guest and Logged in Customer User Read More »

Apex Trigger Practice (4)

Prerequisites Standard Contact Object There is checkbox Field on Contact called “Active” A custom object “Employment Detail” as child object of Contact Object There is a picklist field “Status” having two values: Employee, Ex-Employee And a lookup field to Conatct Requirement: If Contact field “Active” is marked as true, then If no record of child …

Apex Trigger Practice (4) Read More »

PD2 Tough Questions – Refresh your amygdala

Integer x = 1; Integer Y = 0; While(x < 10){Y++;} Will go in infinite loop because x is not being updated inside loop to break the condition. Integer x = 1; Integer Y = 0;While(x < 10){Y++;} ______________________ Contact con = new Contact( LastName = ‘JOHNSON’, email = ‘Web@test.com’);Savepoint sp = Database.setSavepoint();insert con;Database.rollback(sp);system.debug(con);con.email = …

PD2 Tough Questions – Refresh your amygdala Read More »