Skip to main content


Showing posts from March, 2020

Open Facebook Messenger | Open Chat Window | Send Message using Lightning Component Salesforce

How to send sms using third party sms APIs from Salesforce ?

How to send SMS using third party sms APIs from Salesforce ?In this blog I will explain how we can send SMS using a third party API service.
You can buy sms from any bulk sms provider, there are tons of bulk sms provider online. Just make sure they are providing API also.
First of all you have to add your bulk sms provider's website in Remote Site Settings. To add the website in Remote Site Settings please follow below steps : 
From Setup, enter Remote Site Settings in the Quick Find box, then select Remote Site Settings.Click New Remote Site.Enter a descriptive term for the Remote Site Name.Enter the URL for the remote site.Optionally, enter a description of the site.Click Save.After adding remote site you can make the callouts to your service provider's website. For testing purpose I am creating a custom Visualforce page with a Sign Up button.
I will be sending the SMS on the click of Sign Up button.
To send the sms on button's click let's create an APEX class as shown be…

How to create Rating with Stars in Visual Force page ?

How to create Rating with Stars in Visual Force page ?To create the Stars Ratings in VF page you need :  Basic knowledge of creating custom VF page and Apex classFill Star Image Empty Star Image 
First let's create a Apex Class and declare an Integer variable to store selected rating value in VF page as shown below : 
1 2 3publicclassRatingCtrl{publicIntegerrating{get; set; }}

After creating the apex class create a visualforce page with Radio Button and CSS for stars as shown below


1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80<apex:pagedocType="html-5.0"controller="RatingCtrl"><apex:slds/><style>.star-ratingfieldset { font-size:0; white-space:nowrap; display:inline-block; width:250px; height:50px; overflow:hidden; position:rela…

How to add Captcha in Web-to-Lead Salesforce ?

How to add Captcha in Web-to-Lead Salesforce ?To Add the captcha in your web-to-lead form, you need to generate it first from Google.
Please follow below steps : 
1. Visit google captcha link and login to your Admin Console
2. Register a new captcha and submit as shown below : 

3. After submitting it you will receive the Site Key & Site Secret. Save it somewhere as we will be using it in salesforce.
4. Now login to your salesforce org and go to web-to-lead from quick find box.
5. Make sure your Web-to-Lead Enabled & Require reCAPTCHA verification is checked as shown below : 

6. Click on create web-to-lead form button.
7. Select required fields and insert the Return url, then click on the search icon near reCAPTCHA API key pair box as shown below : 

8. Create a new captcha key pair and save it.

9. Use this key pair name in captcha textbox.
10. Click Generate button to generate the HTML code.
Note : Make sure you use the form in the same domain for which y…

How to Automatically download csv file from SFTP and upload it to Salesforce using CLI Dataloader and Batch ?

How to Automatically download csv file from SFTP and upload it to Salesforce using CLI Dataloader and Batch ?ORHow to upload csv file to Salesforce Automatically using batch and window scheduler ?

So basically the requirement was to automatically download the file from a FTP/SFTP and upload the file in Salesforce Leads.
To achieve this functionality in short we will create a batch to download the file from FTP/SFTP and save it in our local machine. And then upload it to salesforce Leads using CLI Data Loader.
Please follow below steps : 

Download & Install WinSCP on a window machine. Connect the FTP/SFTP using credentials. Go to session → Generate session URL/code. Check only User Name, Password & Initial directory in the case of FTP. In the case of SFTP check SSH host key checkbox also. Copy the generated url. Create a txt file using following code below : 

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15# Connect Open URL COPIED FROM STEP 5# Change remote directory cd /# Download…

Refresh State of Lightning Component after the lightning navigation gets changed.

How to refresh the state of Lightning Component after change of lightning navigation ?

So in my scenario I am having two record types on opportunity and I am rendering the attributes on the component based on the Record Type ID.
For example let's say I am having "RT1" and "RT2". In my doInIt method I was first checking the record type name & Id and based on that I was rendering the attributes.
At first time while creating new opportunity and selecting "RT1", it was displaying "RT1" in my doInIt method. But while I navigate to opportunity again and try creating a new opportunity with "RT2", my doInIt method didn't get triggered as the component was in his old state where the doInIt method was already triggered.
To solve this issue I added lightning:isUrlAddressable in my component as shown below :


After adding the isUrlAd…