Biswajeet Samal - The Programmer
827 FOLLOWERS
I'm Biswajeet Samal. I'm a certified Salesforce professional and an experienced consultant.
Biswajeet Samal - The Programmer
1y ago
The blow code is replacing the SSN number with * from a sentence.
Sample Code:
String searchText = 'This is your SSN 000-45-6789 number';
Pattern objPattern = Pattern.compile('[0-9]{3}-[0-9]{2}-[0-9]{4}');
String result = objPattern.matcher(searchText).replaceAll('***-**-****');
System.debug('searchText-' + searchText);
System.debug('result-' + result ..read more
Biswajeet Samal - The Programmer
1y ago
import { LightningElement, track } from 'lwc';
import { NavigationMixin } from 'lightning/navigation';
export default class TestComponent extends NavigationMixin(LightningElement) {
@track accountId = '0018G00000KsFcJQAV';
handlenavigateToAccountViewPage(event) {
this[NavigationMixin.GenerateUrl]({
type: 'standard__recordPage',
attributes: {
recordId: this.accountId,
objectApiName: 'Account',
actionName: 'view'
}
}).then(generatedUrl => {
window.open(generatedUrl ..read more
Biswajeet Samal - The Programmer
1y ago
BusinessHours bh = [SELECT Id, Name, IsActive, IsDefault, SundayStartTime, SundayEndTime,
MondayStartTime, MondayEndTime, TuesdayStartTime, TuesdayEndTime,
WednesdayStartTime, WednesdayEndTime, ThursdayStartTime, ThursdayEndTime,
FridayStartTime, FridayEndTime, SaturdayStartTime, SaturdayEndTime,
TimeZoneSidKey FROM BusinessHours WHERE IsDefault = true];
DateTime startTime;
DateTime endTime;
Datetime dt = System.now();
String dayOfWeek = dt.format('EEEE');
if(dayOfWeek.equalsIgnoreCase('Saunday')){
startTi ..read more
Biswajeet Samal - The Programmer
3y ago
A component can send a toast notification that pops up to alert users of a success, error, or warning. A toast can also simply provide information. To display a toast notification in Lightning Experience or Lightning communities, import ShowToastEvent from the lightning/platformShowToastEvent module. Here is the example to show Lightning Web Component(LWC) Toast Messages.
Toast Event Properties:
Parameter
Type
Description
title
String
(Required) The title of the toast, displayed as a heading.
message
String
(Required) A string representing the body of the message. It can contain place ..read more
Biswajeet Samal - The Programmer
3y ago
Apex Class:
public class AccountController {
@AuraEnabled//Get Account Records
public static String getAccountList(Integer pageSize, Integer pageNumber){
String jsonDT = '';
//Offset for SOQL
Integer offset = (pageNumber - 1) * pageSize;
//Total Records
Integer totalRecords = [SELECT COUNT() FROM Account];
Integer recordEnd = pageSize * pageNumber;
AccountDTWrapper objDT = new AccountDTWrapper();
objDT.pageSize = pageSize;
objDT.pageNumber = pageNumber;
objDT.recordStart ..read more
Biswajeet Samal - The Programmer
3y ago
Apex Class:
public class AccountController {
@AuraEnabled//Get Account Records
public static String getAccountList(Integer pageSize, Integer pageNumber, String sortingField, Boolean isSortAsc){
String jsonDT = '';
//Offset for SOQL
Integer offset = (pageNumber - 1) * pageSize;
//Total Records
Integer totalRecords = [SELECT COUNT() FROM Account];
Integer recordEnd = pageSize * pageNumber;
String sortBy = isSortAsc ? 'ASC' : 'DESC';
String query = 'SELECT Id, Name, AccountNumber, Ind ..read more
Biswajeet Samal - The Programmer
3y ago
A lightning:formattedUrl component displays a read-only representation of a URL as a hyperlink with an href attribute. The link can be a relative or absolute URL.
Sample Code:
<aura:component>
<aura:attribute name="recordId" type="String" default="0063X0000146rTLQAY"/>
<lightning:formattedUrl value="{!'/' + recordId}" tooltip="Opportunity" label="Opportunity" />
</aura:component> ..read more
Biswajeet Samal - The Programmer
3y ago
Create new article:
Knowledge__kav ka = new Knowledge__kav();
ka.Title = 'Salesforce CRM';
ka.UrlName = 'salesforce-crm';
ka.Summary = 'Salesforce Cloud CRM';
ka.Language = 'en_US';
insert ka;
Publish a draft article:
String knowledgeArticleId = 'kA06g000002AJ7t'; //Add knowledge article record id
KbManagement.PublishingService.publishArticle(knowledgeArticleId, true);
Unpublish a published article:
String knowledgeArticleId = 'kA06g000002AJ7t'; //Add knowledge article record id
KbManagement.PublishingService.publishArticle(knowledgeArticleId, true);
Schedule archive of a published artic ..read more
Biswajeet Samal - The Programmer
3y ago
Sample Code:
//Parent Record
Account acc = new Account(Name = 'Test Account');
insert acc;
//Create Related Feed Item Record
FeedItem fi = new FeedItem(ParentId = acc.Id, Body = 'Test Body');
insert fi;
//Create Feed Comment Record
FeedComment fc = new FeedComment(FeedItemId = fi.Id, CommentBody = 'Test Comment');
insert fc;
//Get Feed Comment Record
FeedComment objFC = [Select Id, CommentBody, FeedItemId, ParentId FROM FeedComment LIMIT 1];
//Check Feed Comment Parent Id
System.assertEquals(objFC.ParentId, acc.Id ..read more
Biswajeet Samal - The Programmer
3y ago
LWCWizard.html
<template>
<lightning-progress-indicator current-step={currentStep} type="base" variant="base">
<lightning-progress-step label="Step 1" value="1" onclick={handleOnStepClick}></lightning-progress-step>
<lightning-progress-step label="Step 2" value="2" onclick={handleOnStepClick}></lightning-progress-step>
<lightning-progress-step label="Step 3" value="3" onclick={handleOnStepClick}></lightning-progress-step>
</lightning-progress-indicator>
<template if:true={isStepOne}> ..read more