Uncategorized

How to get BASE URL in LWC

We actually don’t need BASE URL when we are using relative URL to work on <a/> tag. However we do need BASE URL when working on absolute URL.

Usually when working on a record, we have record ID, but we need to redirect using a <a/> tag on click of the name. and We may some time need to generate absolute URL and append record if to it. In this blog we will see how we can get BASE URL in lightning web component’s Javascript file.

Continue reading “How to get BASE URL in LWC”
Uncategorized

User Mode and System Mode of Apex Class in Salesforce.

Why do we have this concept in salesforce?

In salesforce there are many restrictions put on user in different ways, like OWD, Profiles, Field-Level Security, Object permissions, Sharing Rules, Role Hierarchy etc. But these restrictions do not apply to System Administrator. System admin has access to all records that are in system irrespective of owner or sharing rules or access to any object or field. An apex classes can be executed by any user in salesforce. An apex class can be triggered from a Visualforce Page, Visualforce Components, Lightning Components, Process Builder, Flow and many more ways. Class in salesforce can be executed in 3 modes in salesforce

  1. with sharing
  2. without sharing
  3. inherited sharing

Use the with sharing or without sharing keywords on a class to specify whether sharing rules must be enforced. Use the inherited sharing keyword on an Apex class to run the class in the sharing mode of the class that called it.

Continue reading “User Mode and System Mode of Apex Class in Salesforce.”