Parul
IndividualForum Replies Created
-
Parul
MemberSeptember 23, 2018 at 6:04 am in reply to: Explain Considerations for Static keyword in Salesforce Apex.static: This keyword defines a method/variable that is only initialized once, and is associated with an (outer) class, and initialization code. We can call static variables/methods by class name directly. No need of creating instance of a class.
-
Parul
MemberSeptember 23, 2018 at 6:00 am in reply to: Field reset on Convert Lead so SOQL cannot query sensitive information in SalesforceHave you looked at the “View and Edit Converted Leads” permission? A user with that permission can view the actual record of a converted lead. Without the permission when you click on a converted lead you will automatically be navigated to the contact or account.
Thanks
-
Parul
MemberSeptember 23, 2018 at 5:59 am in reply to: How to convert carriage returns in Textarea to Line Breaks in Salesforce Visualforce?if(trim($_POST['message']) == '') {
$hasError = true;
} else {
if(function_exists('stripslashes')) {
$comments = stripslashes(trim($_POST['message']));
} else {
$comments = trim($_POST['message']);
}
$comments = nl2br($comments);
} -
Parul
MemberSeptember 23, 2018 at 5:51 am in reply to: Explain ActionFunction, ActionSupport and ActionPoller in Salesforce Visualforce.actionFunction: It is used to call the server side method using javaScript.
actionSupport: It is used to call the server based on the client side event i.e. like onclick, onchange etc.
actionPoller: It is used to call the server side method in a regular interval of time.
actionRegion: An area of a Visualforce page that demarcates which components should be processed by the Force.com server when an ajax request is generated.
Thanks
-
Parul
MemberSeptember 23, 2018 at 5:48 am in reply to: What is the difference between “apex:dataTable” and “apex:pageBlockTable” components in Salesforce Visualforce?Apex:dataTable – An HTML table that is defined by iterating over a set of data, displaying information about one item of data per row. The data set can include up to 1,000 items.->no need to write inside <apex:pageblock> or <apex:pageblocksection>
-> there is no required value
-> the data can be displayed using custom styles
-> we need to specify column headers explicitlyApex:pageBlockTable – A list of data displayed as a table within either an < apex:pageBlock > or < apex:pageBlockSection > component, similar to a related list or list view in a standard Salesforce page. Like an < apex:dataTable >, an < apex:pageBlockTable > is defined by iterating over a set of data, displaying information about one item of data per row. The set of data can contain up to 1,000 items.The body of the
< apex:pageBlockTable > contains one or more column components that specify what information should be displayed for each item of data, similar to a table. Unlike the < apex:dataTable > component, the default styling for < apex:pageBlockTable > matches standard Salesforce styles.
-
Parul
MemberSeptember 23, 2018 at 5:46 am in reply to: How to get selected records ID from List View using Javascript / Ajax Toolkit in Salesforce?Create a new Button on Lead of type List Button and then Add the button on Lead List View Layout.
-
Parul
MemberSeptember 23, 2018 at 5:45 am in reply to: Anyone logged in to API can see the javascript code, your username and password - how to avoid this in Salesforce?Global session variable is available in VF page so when we create a visualforce page with output type as JavaScript first initialize the global javascript variable in that VF page and then include VF page as a javascript file I think then it avoided.
-
Parul
MemberSeptember 23, 2018 at 5:42 am in reply to: In Custom Component, how we can return value to Custom Controller or Controller Extension in Salesforce?Objects are passed by instance so the value is changed in custom component we will get updated value in controller also.
Thanks
-
Parul
MemberSeptember 23, 2018 at 5:37 am in reply to: Will system.debug() statement get executed in Trigger after adderror() method in Salesforce?Adderror() is not a statement its execution method and a flow and all the code written inside the method will executed.
-
Parul
MemberSeptember 23, 2018 at 5:35 am in reply to: How to clear the Time based workflow action queue in Salesforce?Create criteria false for all the records by using the checkbox or by removing the queue from Time based workflow action queue
-
Parul
MemberSeptember 23, 2018 at 5:30 am in reply to: How to restrict the controller action for users which are logged in using “Grant Login Access” in Salesforce?There's no supported way to detect that a user is masquerading as another user via Grant Login Access. I have seen some suggestions around cookie sniffing, but as you want to restrict access I'd say that would be a very fragile.
-
Parul
MemberSeptember 23, 2018 at 5:28 am in reply to: What is the best way to check if organization has Person Account enable or not using Salesforce Apex?Using isPersonAccount property on an Account and catch any exception that occurs if that property is missing. If an exception is generated then person accounts are disabled. Otherwise they’re enabled. To avoid making person accounts required for the package you assign the Account object to an sObject and use sObject.get( ‘isPersonAccount’ ) rather than accessing that property directly on the Account object.
Thanks.
-
Parul
MemberSeptember 23, 2018 at 5:26 am in reply to: How to resolve error “Non-selective query against large object type” in Salesforce?If you're running a trigger on objects that have more than 200,000 records, it's possible that you'll receive the error, "System.QueryException: Non-selective query against large object type." We'll go over the a few possible fixes. Resolution.
Options to resolve error. -
Parul
MemberSeptember 23, 2018 at 5:08 am in reply to: Can you use Group by clause inside inner query in Salesforce SOQL?SELECT Id, Name,(SELECT Count(Id),Name FROM Contacts Group By Name Having count(Id) > 1 ) FROM Account
No only root queries support aggregate expression.
-
Parul
MemberSeptember 23, 2018 at 5:06 am in reply to: How to implement the pagination in Salesforce Object Query Language (SOQL)?Hi
Yes you can implement pagination in Visualforce as follows:
<apex:pageblockSection >
<apex:outputPanel id=”myPanel”>
<apex:PageBlockTable var=”c1″ value=”{!cnd}”>
<apex:column headerValue=”First Name”>
<apex:inputField value=”{!c1.First_Name__c}”/>
</apex:column>
<apex:column headerValue=”Last Name”>
<apex:inputField value=”{!c1.Last_Name__c}”/>
</apex:column>
<apex:column headerValue=”City”>
<apex:inputField value=”{!c1.City__c}”/>
</apex:column>
<apex:facet name=”footer”>Showing Page # {!pageNumber} of {!totalPages}</apex:facet>
</apex:PageBlockTable>
</apex:outputPanel>
</apex:pageblockSection>Thanks
-
Parul
MemberSeptember 23, 2018 at 5:05 am in reply to: How to generate the random string or random password using Salesforce Apex?Hi,
Adding some code snippet
Here is a static method that accepts a desired string length as an argument. It takes a full string of ASCII numbers and letters and loops through the index of your desired string length, randomly choosing an index in the full character string.
public static String generateRandomString(Integer len) {
final String chars = ‘ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789abcdefghijklmnopqrstuvwxyz’;
String randStr = ”;
while (randStr.length() < len) {
Integer idx = Math.mod(Math.abs(Crypto.getRandomInteger()), chars.length());
randStr += chars.substring(idx, idx+1);
}
return randStr;
}Thanks
-
Dynamic Visualforce Bindings means fields on the page are determined at run time, rather than compile time.
Use them on a page like this:{!reference[expression]}
Static Bindings means fields on the page are determined at compile time.
-
Public class LeadClass{
public static void doConvert(Id leadId){Database.LeadConvert lc = new database.LeadConvert();
lc.setLeadId(leadId);
lc.setDoNotCreateOpportunity(True);LeadStatus convertStatus = [SELECT Id, MasterLabel FROM LeadStatus WHERE IsConverted=true LIMIT 1];
lc.setConvertedStatus(convertStatus.MasterLabel);
Database.LeadConvertResult lcr = Database.convertLead(lc);
}
}Thanks
-
Parul
MemberSeptember 23, 2018 at 5:03 am in reply to: How can you determine that email is actually sent or not from the Salesforce?you can manually check it that the email could use from setup menu under monitoring. From the email log page: “Email logs describe all emails sent through salesforce.com and can be used to help identify the status of an email delivery.
-
Parul
MemberSeptember 23, 2018 at 4:59 am in reply to: Give any scenario when you cannot change the currency field type to numeric type in Salesforce.With apex trigger or in class you cannot change the currency field type to numeric type.
-
Parul
MemberSeptember 23, 2018 at 4:58 am in reply to: How to add the Document Header in Salesforce Visualforce page?I am trying to do something on similar lines. Tried using the tags mentioned in the thread but it throw an error
-
Parul
MemberSeptember 23, 2018 at 4:57 am in reply to: How to achieve the below given command line using Salesforce Apex?This will tell IE9 that you would prefer it operate like IE8, and IE8 still works fine. However, I believe this meta tag needs to be one of the first things declared in the page, and under some situations (like showHeader=true) you may not have control over that. In that case, you can add the following to the Apex controller:
Apexpages.currentPage().getHeaders().put('X-UA-Compatible', 'IE=8');
Remember that Apex controllers can also be served up as extensions to other custom controllers or standard controllers – so if you need to add this to several pages but don't want to rewrite the constructor of each controller, you can add one extension, place the above in the constructor – and then add the extension to existing pages without having to manipulate a lot of existing Apex. -
Parul
MemberSeptember 23, 2018 at 4:53 am in reply to: How to display the formatted number / date in Salesforce Visualforce? Which component should be used?code snippet
<td style="white-space:nowrap;">
<apex:inputText value="{0,StartDateTime,MM'/'dd'/'yyyy}" disabled="true" >
<apex:param value="{!evento.StartDateTime}" />
<apex:inputText>
</td> -
Parul
MemberSeptember 23, 2018 at 4:45 am in reply to: What is Difference between “Printable View” and “Export Details” button on Salesforce Report?Formatting, grouping and subtotals are persisted by Printable view.
formatting, grouping and subtotals are lost by Export Details
-
Parul
MemberSeptember 23, 2018 at 4:43 am in reply to: While creating new profile for user, which existing profile should be copied in Salesforce?When creating user there are number of license but System administrator is not for new user then copy from the "Standard user" profile.
Thanks