Import CSV file data using Apex & VF page

Here is the sample example how to import csv file data into salesforce. VF Page: <apex:page sidebar="false" controller="ImportCSVFile"> <apex:form > <apex:sectionHeader title="Upload CSV data File"/> <apex:pageBlock > <center> <apex:inputFile value="{!FileContent}" filename="{!Filename}" /> <apex:commandButton action="{!ReadFile}" value="Upload File" id="theButton" style="width:70px;"/> <br/> <br/> <font color="red"> <b>Note: Please use the standard template to upload Accounts.</b> </font> </center> <apex:pageblocktable value="{!uploadedAccounts}" …

Continue reading Import CSV file data using Apex & VF page

Upload the file from external system into salesforce

This is sample example how to fetch one file in google system (example: Live Agent guide) Url: https://resources.docs.salesforce.com/sfdc/pdf/live_agent_dev_guide.pdf and uploading as a attachment into contact record in salesforce. Apex Class: Public class UploadFileintoSalesforce{ public static blob fetchfile(String fileurl){ Http h = new Http(); HttpRequest req = new HttpRequest(); fileurl = fileurl.replace(' ', '%20'); //Set the end point URL req.setEndpoint(fileurl); req.setMethod('GET'); req.setHeader('Content-Type', 'application/pdf'); req.setCompressed(true); req.setTimeout(60000); HttpResponse res  = h.send(req); system.debug('Response  ' + res.getBody()); blob Fileret = res.getBodyAsBlob(); return Fileret; } public static Id createAttachment(blob fileContent, String recordId, String fileType){ //for pdf files content type should be pdf //for jpeg file content type should be image/jpeg Attachment attach = new Attachment(); attach.ParentId = recordId; attach.Name = 'FileAttached.pdf'; attach.Body = fileContent; attach.contentType = fileType; insert attach; …

Continue reading Upload the file from external system into salesforce

Translating Language in VF page

  Here in this post , explaining a sample VF page, how to translate field values into different languages in salesforce on contact object. Lets first understand about SelectOption SelectOption Class A SelectOption object specifies one of the possible values for a Visualforce selectCheckboxes, selectList, or selectRadio component. Namespace System SelectOption consists of a label that is displayed to the end user, …

Continue reading Translating Language in VF page

Sample Progress Indicator Lightning Component(Loan Process Example)

Here in this post i am sharing how to create a lightning component to show progress indicator for loan process(Anything we can use for case status/Opportunity stage etc.,) Create a Lightning Component (LoanProcess): LoanProcessController.js: ({ handleNext : function(component,event,helper){ var getselectedStep = component.get("v.selectedStep"); if(getselectedStep == "LoanInfo"){ component.set("v.selectedStep", "BasicInfo"); } else if(getselectedStep == "BasicInfo"){ component.set("v.selectedStep", "ResidenceInfo"); } …

Continue reading Sample Progress Indicator Lightning Component(Loan Process Example)

What are the Components Available /Not Available in Salesforce Change sets.

Here in this post i am giving list of components available  and Non- available to add in Change sets. Available components: The following types of components can be added to a change set. Action Action Link Group Template Apex Class Apex Sharing Reason Apex Trigger App Approval Process Asset File Assignment Rule Auth. Provider Auto-Response Rule …

Continue reading What are the Components Available /Not Available in Salesforce Change sets.