Piyush
IndividualForum Replies Created
-
Piyush
MemberSeptember 23, 2019 at 11:59 am in reply to: How to import CSV file to create a record in sfdc using apex code?Hi Saddam,
<apex:page controller="importDataFromCSVController"> <apex:form > <apex:pagemessages /> <apex:pageBlock > <apex:pageBlockSection columns="4"> <apex:inputFile value="{!csvFileBody}" filename="{!csvAsString}"/> <apex:commandButton value="Import Account" action="{!importCSVFile}"/> </apex:pageBlockSection> </apex:pageBlock> <apex:pageBlock > <apex:pageblocktable value="{!accList}" var="acc"> <apex:column value="{!acc.name}" /> <apex:column value="{!acc.AccountNumber}" /> <apex:column value="{!acc.Type}" /> <apex:column value="{!acc.Accountsource}" /> <apex:column value="{!acc.Industry }" /> </apex:pageblocktable> </apex:pageBlock> </apex:form> </apex:page>
public class importDataFromCSVController { public Blob csvFileBody{get;set;} public string csvAsString{get;set;} public String[] csvFileLines{get;set;} public List<account> acclist{get;set;} public importDataFromCSVController(){ csvFileLines = new String[]{}; acclist = New List<Account>(); } public void importCSVFile(){ try{ csvAsString = csvFileBody.toString(); csvFileLines = csvAsString.split('n'); for(Integer i=1;i<csvFileLines.size();i++){ Account accObj = new Account() ; string[] csvRecordData = csvFileLines[i].split(','); accObj.name = csvRecordData[0] ; accObj.accountnumber = csvRecordData[1]; accObj.Type = csvRecordData[2]; accObj.AccountSource = csvRecordData[3]; accObj.Industry = csvRecordData[4]; acclist.add(accObj); } //insert acclist; } catch (Exception e) { ApexPages.Message errorMessage = new ApexPages.Message(ApexPages.severity.ERROR,'An error has occured while importin data Please make sure input csv file is correct'); ApexPages.addMessage(errorMessage); } } }
for more you can refer http://www.sfdcpoint.com/salesforce/import-csv-file-using-apex-visualforce/
-
Piyush
MemberSeptember 23, 2019 at 11:54 am in reply to: What is Visualforce page problem in Salesforce?Hi,
You can take help from this example :-
<apex:page controller="Abc"> <apex:form id="form"> <apex:actionFunction name="loadPageContent" action="{!THREESeconds}" status="loading" reRender="form" /> </apex:form> <apex:actionStatus id="loading"> <apex:facet name="start"> <img src="/img/loading32.gif" style="vertical-align: middle; padding-right: 1em" /> Loading... </apex:facet> </apex:actionStatus> <script> loadPageContent(); </script> </apex:page>
public class Abc { public void THREESeconds() { Long startTime = DateTime.now().getTime(); while(DateTime.now().getTime()-startTime<3000); } }
-
Piyush
MemberSeptember 23, 2019 at 11:42 am in reply to: Can we integrate Lightning components with another framework, such as Angular?Hi Yogesh,
Yes, Lightning components can be integrated with any third-party framework like Angular.
-
Piyush
MemberSeptember 20, 2019 at 3:02 am in reply to: How to create a Last Campaign date in a Contact record in salesforce? -
Piyush
MemberSeptember 20, 2019 at 2:55 am in reply to: What is the difference between public group and Queue why salesforce people develop both?Hi Deepak,
Public Group:- Public Group is solely used for sharing. Public Group is kind of team or group of related users; this will help you to share the data. Public group created can be used across any objects.
Queue:- Queue is used for load balancing. Queue is a feature available to salesforce.com users that allows you to integrate prospect assignments with your current salesforce.com workflow. Rather than assigning to a specific user, you can choose to assign leads to a salesforce.com queue and then use your CRM workflow or manual method of distributing leads to sales representatives. Queue can be created for Custom objects and for Case, Lead and Knowledge Article Version.
-
Piyush
MemberSeptember 20, 2019 at 2:47 am in reply to: Problem in response.getReturnValue() result when storing in two attributes in salesforceHi Deepak,
You can use like this in your program:-
component.set("v.pricebookProductsCopy", [response.getReturnValue()]);
-
Piyush
MemberSeptember 19, 2019 at 8:18 am in reply to: How to count the number of SOQL statement received in a request ?Hi,
You can use like this in your program to count the number of SOQL statement received in a request:-
Result[] count = [select count(id) from Service__c ]; System.debug(count.size());
-
Hi,
A connected app can use the OAuth authorization protocol to access protected resources. As part of the protocol, OAuth default scopes fine-tune the app’s permissions to access protected resources in Salesforce. However, these default scopes are insufficient when an external entity is hosting the protected resource. In this scenario, Salesforce plays the role of OAuth authentication and authorization provider, but it has little knowledge about the resource it’s protecting. To define a connected app’s permissions to access protected resources hosted by an external entity, create an OAuth custom scope. The custom scope tells the external entity which information the connected app is authorized to access.
-
Hi,
Login flows allow admins to build post-authentication processes to match their business practices, associate the flow with a user profile, and send the user through that flow when logging in. Salesforce directs users to the login flow after they authenticate but before they access your org or community. After users complete the login flow, they’re logged in to your Salesforce org or community. The login process can also log out users immediately if necessary.
-
Piyush
MemberSeptember 19, 2019 at 6:33 am in reply to: Is it possible to download a vf page by clicking custom button in salesforce?Hi Deepak,
<apex:page id="MainPage" showHeader="false" cache="true" contentType="application/x-pdf#Here-is-your-filename.pdf"> <!-- Here comes another page with a content to be converted to PDF --> <apex:include pageName="PageThatGeneratesPdf"/> </apex:page>
<apex:page showHeader="false" renderAs="PDF" cache="true"> <head> <meta http-equiv="Content-Type" content="text/html;charset=UTF-8" /> <style type="text/css"> @page{ size:A4 portrait; @bottom-right { content: "Page " counter(page) " - " counter(pages); font-family: 'Arial', 'Helvetica', sans-serif; font-size:10px; } } </stype> </head> Here is your main content ... </apex:page>
-
Hi David,
Workflow rules can not be used to deactivate user who has not logged into their Salesforce account for this scenario.
-
Piyush
MemberSeptember 18, 2019 at 3:31 am in reply to: For writing mock test class for an apex class is it necessary to write a test class also or not?Hi,
Yes, It is necessary to write a test class also where you can call the Mock class.
-
Hi,
You can take help from this example:-
public class MyClass { class RGB { Integer red; Integer green; Integer blue; RGB(Integer red, Integer green, Integer blue) { this.red = red; this.green = green; this.blue = blue; } } static Map<String, RGB> colorMap = new Map<String, RGB>(); static { colorMap.put('red', new RGB(255, 0, 0)); colorMap.put('cyan', new RGB(0, 255, 255)); colorMap.put('magenta', new RGB(255, 0, 255)); } }
-
Piyush
MemberSeptember 18, 2019 at 3:16 am in reply to: how to create a custom perspective in Salesforce?Hi Nikita,
Creating Custom Perspectives in the Log Inspector:-
- In the Developer Console, open a log in the Log Inspector.
- Click Debug | View Log Panels and select the panels you want to include in the perspective. For a list of available panels, see Log Panels. If you modify a perspective, an * is appended to the perspective name until it is saved. Tip If you create a perspective that includes the Execution Log panel, you may want to include the Source panel.
- To save your changes, click Save Perspective. To create a new perspective, click Save Perspective As and enter a new name.
-
Hi Hariom,
Bucket field in Salesforce Reports is an incredibly powerful functionality used to quickly categorize values for a field in a report without the need to have a custom formula field at the object level. When you create a bucket field in Salesforce, you define multiple categories into groups depending on the record values, this bucket field will not affect other Salesforce reports. Bucket fields in Salesforce are available in Tabular reports, Summary Reports, and Matrix report. Joined Reports does not support Bucket fields.
-
Hi Hariom,
SaaS benefits:-
- Low setup and infrastructure costs
- Accessible from anywhere
- Scalability
- Industry leading service level agreements (SLAS) for uptime and performance
- Automatic, frequent updates
- Security at the highest level required by any customer
-
Hi,
- Any permission with respect to creation /deletion/Updating/viewing of an object is possible only through permission set or Profile.
- Meaning If we are able to create records in an object then the Create Permission in either Profile or in Permission Set should be enabled. If it's not enabled in the Profile then it has been in the Permission Set.
- So check for the permission set.
-
Piyush
MemberSeptember 17, 2019 at 4:32 am in reply to: What are the limits for the Salesforce and Salesforce Platform Licences in the salesforce ?Hi,
There is no hard limit per profile. This is because a user's access can be modified by Permission Sets. You are limited to 10 or 110 custom objects per user, with org limits on the total number of custom objects. In other words, if you are limited to 10 objects per user, and you assign a combination of permission sets that exceed this limit, you are in violation of your contractual agreement. Note that Salesforce does not place technical restrictions to prevent this situation from happening, but may charge you retroactively for violations of your contractual limits.
-
Piyush
MemberSeptember 16, 2019 at 6:08 am in reply to: What is External Data Sources in Salesforce?Hi Saddam,
An external data source specifies how to access an external system. Salesforce Connect uses external data sources to access data that's stored outside your Salesforce organization. Files Connect uses external data sources to access third-party content systems.
-
Hi,
External Services is a feature within Salesforce that leverages declarative tools to connect to an external endpoint, such as a credit service provider, and bring its logic into Salesforce.
-
Hi,
OData (Open Data Protocol) is an ISO/IEC approved, OASIS standard that defines a set of best practices for building and consuming RESTful APIs. OData helps you focus on your business logic while building RESTful APIs without having to worry about the various approaches to define request and response headers, status codes, HTTP methods, URL conventions, media types, payload formats, query options, etc. OData also provides guidance for tracking changes, defining functions/actions for reusable procedures, and sending asynchronous/batch requests.
-
Hi,
Content Security Policy is enforced by adding an HTTP header with name “Content-Security-Policy” and defining a rule pattern. Based on the ruleset defined, the browser restricts the web page from downloading malicious content from unknown sources.
-
Piyush
MemberSeptember 16, 2019 at 5:12 am in reply to: What is not supported in Salesforce Lightning as compared to Salesforce Classic?Hi Ranjith,
What do you want to ask? please specify the question clearly.
-
Piyush
MemberSeptember 13, 2019 at 3:34 am in reply to: How we can do bulk updates using MAP in Salesforce ?Hi Hariom,
You can take help from this example:-
Map<Id, String> m = new Map<Id, String>();
Opportunity[] updates = new Opportunity[] {};
for (Id id : m.keySet()) {
updates.add(new Opportunity(Id = id, FieldName__c = m.get(id)));
}
update updates; -
Piyush
MemberSeptember 13, 2019 at 3:16 am in reply to: What is Salesforce community knowledge article?Hi Deepak,
Salesforce Community Knowledge is the knowledge base solution that is part of the Salesforce Service Cloud, a comprehensive package of components and modules that gives you a complete customer view and enables you to provide intelligent, fast, and personalized customer service. The array of solutions under Service Cloud connects and works with each other to help you streamline processes, simplify workflows, and easily make available important articles, information, and expert agents to your customers, regardless of what device and channel they use.
Salesforce Community Knowledge is designed for self-service so your customers can search for helpful information and resources on their own about issues relating to your business, product or services. Likewise, the solution enables your agents to find the right answer faster with a knowledge management tool that can help you extend responsive and efficient customer care. With the online public knowledge base platform, you help your customers help themselves with easy access to knowledge base articles, FAQ, and the collective wisdom of the active Salesforce community.