Tuesday, September 28, 2021

Fix column in custom scrollable table using LWC in salesforce

This post explains how to fix the column in custom table using lightning web component.


Below is the demo of output:

Fix column in LWC salesforce



fixColumn.cmp :


<template>
    <div class="table-scroll">
        <table>
            <thead>
                <tr>
                    <th class="fix">
                        <div> Head </div>
                    </th>
                    <th>
                        <div> Head 1 </div>
                    </th>
                    <th>
                        <div> Head 2 </div>
                    </th>
                    <th>
                        <div> Head 3 </div>
                    </th>
                    <th>
                        <div> Head 4 </div>
                    </th>
                </tr>
            </thead>
            <tbody>
                <tr>
                    <td class="fix">
                        <div> Lovesalesforceyes </div>
                    </td>
                    <td>
                        <div> Fix column </div>
                    </td>
                    <td>
                        <div> with </div>
                    </td>
                    <td>
                        <div> LWC </div>
                    </td>
                    <td>
                        <div> Salesforce </div>
                    </td>
                </tr>
            </tbody>
        </table>
    </div>
</template>

fixColumn.css :


table {
 background-color: white;
}
.table-scroll {
  overflow: auto;
}
table th{
  min-width: 140px;
  height: 50px;
  text-align: center;
}
table td{
  height: 50px;
  text-align: center;
}
.fix{
    position: sticky;
    left: 0;
    z-index: 1;
    background: #f8f8f8;
 }


Explanation :


Basically this is just a two line CSS work. Main thing you have to look at in this code is to fix class CSS. Position fix the first column and z-index show the first column above over other columns. Left is 0 because the requirement is to fix the first column. If you have to fix more than the first column then you have to adjust left according to that. In the same way you can also fix the header by changing left to top.

Thanks, 
Lovesalesforceyes


Sunday, September 19, 2021

How to get a free salesforce certification voucher

In this post I will explain the ways from which you can get a free salesforce certification voucher.

First thing about this voucher is that you can't get this voucher without doing anything, you have to earn it.

free salesforce certification voucher



1.) Trailhead Quests

This is the most common way to earn certification vouchers and prizes. These quests are updated every month by trailhead, so keep checking after every 15 days. In this you have to complete any quest within a given timeline and you will be eligible for the voucher or prizes. Almost 10 days after completing the timeline lucky winners will get their voucher by email. Learn about the quest before starting.

2.) Journey2Salesforce program

Journey2Salesforce program is for those who want to become salesforce developers. It is the best program to learn salesforce. After completing this program you are eligible to win a 200$ certification voucher.
  • First you have to register for this program.
  • There are four trailmix in this program which you have to complete.
  • In single trailmix there are multiple badges and superbadges also.
  • After completing trailmix 1,2 and 3 you will get some prizes.
  • After completing the full program you are eligible to win PD1 voucher for free
  • There is no starting and ending time to complete this program.

3.) Trailblazer community groups

You can also win salesforce certification vouchers by joining the Trailblazer community groups. First you have to register for some event. There are some tasks in the event which you have to complete to win the voucher.

You can also join the Certification Day webinar in which all attendees will get 40 or 70 $ certification. 

These are the only ways from which you can earn free salesforce certification vouchers.


Thanks, 
Lovesalesforceyes

Saturday, September 18, 2021

Show Success, Error, Information and Warning messages in LWC

This post explains how can we show success and error messages in LWC with the help of lightning toast. With the help of toast you can show any kind of of message in LWC.

Toast is basically used to show message after performing any action by user based on the condition.
We can customize style and visibility of toast according to our requirement. Below is the attribute which you can use to customize the toast:

  • title : It is required parameter. Title display as heading of message. Title will be displayed in bold.
  • message : It is also a required parameter. In this attribute you can specify the message which you want to show in the toast.
  • duration : This value is used to set toast visibility duration. Default value of this attribute is 3000 ms.
  • variant : This attribute is used for the appearence of the toast. Valid values for this attribute are:
info : Grey color toast for showing information message(Default value of this attribute).
success : Green color toast for showing success message.
warning : Orange color toast for showing warning message.
error : Red color toast for showing error message.

  • mode :  This attribute is used to control how user can close the toast. Valid values for this attributes are: 
dismissible : It is a default value of this attribute. Toast will visible until you hit close button or duration has elapsed(3000 ms by default).
pester : With this value user can't close the toast because there is no close button. Toast will close automatically after duration has elapsed.
sticky : With this value toast will only close after uset hit the close button. 


ShowErrorMessage.cmp :


<template>
    <lightning-button label="Success" onclick={success}></lightning-button>
    <lightning-button label="Error" onclick={error}></lightning-button>
    <lightning-button label="Warning" onclick={warning}></lightning-button>
    <lightning-button label="Information" onclick={info}></lightning-button>
</template>


ShowErrorMessage.js :


import { LightningElement,track,api } from 'lwc';
import { ShowToastEvent } from 'lightning/platformShowToastEvent';
export default class ShowErrorMessage extends LightningElement {

    success(){
        const event = new ShowToastEvent({
            title: 'Success Message',
            message: 'This is used to show success message',
            variant: 'success',
            mode: 'dismissable'
        });
        this.dispatchEvent(event);
    }


    error() {
        const event = new ShowToastEvent({
            title: 'Error Message',
            message: 'This is used to show error message',
            variant: 'error',
            mode: 'dismissable'
        });
        this.dispatchEvent(event);
    }
 
    warning(){
        const event = new ShowToastEvent({
            title: 'Warning Message',
            message: 'This is used to show warning message',
            variant: 'warning',
            mode: 'dismissable'
        });
        this.dispatchEvent(event);
    }
 
    info() {
        const event = new ShowToastEvent({
            title: 'Info Message',
            message: 'This is used to show information message',
            variant: 'info',
            mode: 'dismissable'
        });
        this.dispatchEvent(event);
    }
}


Sucess message in LWC

Error message in LWC

Warning message in LWC

Information message in LWC



Thanks, 
Lovesalesforceyes






Wednesday, September 8, 2021

How to get a salesforce developer job as a fresher

In this post I will give you some information about salesforce development and how to get a salesforce developer job if you are fresher(as a fresher).


Do you want to get salesforce developer job as a fresher. Have you ever heard about Salesforce? frankly, i am from a computer science background but still, i had no idea till the first day of my career what salesforce is. Salesforce is the world's best CRM which can provide 360 solutions to all the business holders.

In India salesforce is still developing but in countries like US ,Canada ,Uk salesforce have a huge demand. So if you want to choose the salesforce developer as your career, you are going in the right direction. Demand of salesforce developers is growing day by day.


Salesforce developer



In the following section I will give you some of the tips to get a salesforce developer job. If you are going for a salesforce developer job as a fresher then you should be prepared for the following things :
  • Logic making skills in any of the languages. If you have good knowledge in java then you will get some weightage because the language used in salesforce(APEX) is similar to java.
  • Kind of orgs in salesforce and difference.
  • Basics of salesforce CRM 
  • What are object and fields and basic of some important objects of salesforce (Account,Contact,Lead,Opportunity)
  • Basics of reports and Dashboards.
  • Basics of admin part(I know you are going for a salesforce developer position but in some of the IT companies developers have also do admin work. so it will be beneficial if you know some important topics like profile, permission set, user, sharing settings).
  • Basics of point and click tools in salesforce(process builder, flows, workflow rule, approval process)
  • Basics of LWC and LC(Aura) frameworks.

Above is all the important topics of salesforce for the freshers. If you have basic knowledge in all the above topics then you are ready for the Interview.


From where can you prepare for the salesforce developer interview:

The best place to learn salesforce is Trailhead. Each and every topic is defined perfectly with usecases and practical examples. Create a free dev org , sign up with trailhead and do practice. The more you practice ,the more you learn.

There is a also a trailhead program #Journey2Salesforce. This program is specially for those who want to become salesforce developers.There is four trailmix in this program and each trailmix contain multiple badges. This is the best program for you. 

At last, best of luck.


Thanks, 
Lovesalesforceyes


Get selected radio button value in LWC

This post explains how to get selected radio button in LWC. Below is demo of output : To use the radio button in LWC you have to use the  li...