Ravi Kant
IndividualForum Replies Created
-
Ravi
MemberApril 26, 2016 at 10:13 am in reply to: Add 'Select All' functionality in pageBlockTableJavascript can be used in visualforce pages to select all checkboxes in visualforce table. There are many resources available on the internet to understand this .
Below is a good blog to understand how this work:
http://www.sfdcpoint.com/salesforce/select-all-checkbox-using-javascript-in-visualforce-page/ .
-
Ravi
MemberApril 26, 2016 at 9:52 am in reply to: How to get the city or state information based on zip code?Hi Utsav,
There are a few third party apps on the app exchange that will help you do this.
http://appexchange.salesforce.com/listingDetail?listingId=a0N30000002zt9uEAA.
If you don't want to use third party App then you have to do some tedious work :
Create a custom object for zip codes where the name field is the Zip Code. Add a text fields to this object for City . Upload all of your zip codes/city to this new object using the data loader or manually create each one, but that sounds painful.
Add a look-up relationship field to the object that you want that is related to this new Zip Code object.
The end user can point this new field to the appropriate Zip Code object by searching the zip code numbers. A formula(s) or work rule can then be used to pull the city into a field(s) on the main object.
-
Ravi
MemberApril 26, 2016 at 9:31 am in reply to: How to use decimal variable on vf page with decimal values?Hi Utsav,
You can use setScale(scale) method of Decimal class to scale your decimal as par requirement.
decimal d = 2;
System.debug('d>>>>'+ d.setScale(2));14:56:43:003 USER_DEBUG [2]|DEBUG|d>>>>2.00
-
Hi Shubham,
May be you are using pageblocktable inside pageblocksection, I am not sure about it since you have not mention your code here.
If the pageblocktable is nested in a pageblocksection then the table headers are a fixed size that can't be influenced by the columns. If you make it a child of a pageblock, the widths are honoured.
<apex:column style="width:200px">
-
Thanks Gourav for your help.
-
Hi Tech,
It's too broad to answer here, first refer salesforce Integration documentation provided by salesforce https://developer.salesforce.com/page/Integration.
If you are facing any specific problem then mention here we will try to resolve this.
-
Ravi
MemberApril 25, 2016 at 11:56 am in reply to: How to pass JavaScript variable value to Apex Controller?You can do this by using ActionFunction and Param tags.
Use this link to understand how it works:
-
Apex has a class called Schema. It contains the entire schema of your organization. Objects, their fields, field type etc. can all be retrieved using this class.
List<Schema.SObjectType> gd = Schema.getGlobalDescribe().Values();
-
Ravi
MemberApril 22, 2016 at 9:35 am in reply to: How to show and hide account custom button on account detail page?/
- This reply was modified 8 years, 7 months ago by Ravi.
-
Data.com Connect is a free contact data service which compares the information you already have to the information in it’s own database – correcting and adding any wrong or missing information in Pardot. In order to do this, all you have to do is click on the Data.com icon next to a prospect’s name.
-
Ravi
MemberApril 22, 2016 at 6:37 am in reply to: How to align pageBlockButtons left or right in a pageBlock?Thanks, Suyash for your help but i already tried firebug to override salesforce css classes but it did not work.
-
Ravi
MemberApril 22, 2016 at 6:04 am in reply to: How to Track field history on Opportunity Line Items?Hi,
You can do it using Custom Object and Trigger not with the Standard History Tracking.
Step 1:
Create a custom object(History_Tracking__c) to store your object history.
Step 2:
Create a Trigger on object where you want to track fields.
Below is the sample code:trigger trackOppProduct on OpportunityLineItem (after insert, after update) {
List<History_Tracking__c> hisTrackList = new List<History_Tracking__c>();
//
// Iterate through the OpportunityLineItems and create the History Tracking Record.
//
for (Integer i=0; i < Trigger.new.size(); i++) {OpportunityLineItem newCM = Trigger.new[i];
if(Trigger.isInsert) {
hisTrackList.add(new History_Tracking__c(OpportunityLineItem_Record_Id__c = newCM.Id,
Object_Name__c = 'OpportunityLineItem',
Field_Name__c = 'Status',
Previous_Value__c = '',
Current_Value__c = newCM.Status,
Modified_Date_Time__c = System.now(),
Modified_By__c = UserInfo.getUserId()
));
} else if(Trigger.old[i].Status != newCM.Status){
OpportunityLineItem oldCM = Trigger.old[i];
hisTrackList.add(new History_Tracking__c(OpportunityLineItem_Record_Id__c = newCM.Id,
Object_Name__c = 'OpportunityLineItem',
Field_Name__c = 'Status',
Previous_Value__c = oldCM.Status,
Current_Value__c = newCM.Status,
Modified_Date_Time__c = System.now(),
Modified_By__c = UserInfo.getUserId()
));
}
}
if(!hisTrackList.isEmpty()) {
insert hisTrackList;
}
} -
here are a few things you acn follow to dedupe salesforce existing data:
Determine what constitutes a duplicate.
Do you "fuzzy" match for likely duplicates.
When you have a duplicate, which data do you carry over to the merged record?. -
It searches an object for a record where specified field matches the specified lookup value. If a match is found, returns another specified value.
syntax of vlookup:
VLOOKUP(field_to_return, field_on_lookup_object, lookup_value)
-
Ravi
MemberApril 14, 2016 at 8:46 am in reply to: Share with me an External Lookup field in Salesforce Example?Use an external lookup relationship when the parent is an external object.
An external lookup relationship links a child standard, custom, or external object to a parent external object.
When you create an external lookup relationship field, the values of the standard External ID field on the parent external object are matched against the values of the external lookup relationship field. For a child external object, the values of the external lookup relationship field come from the specified External Column Name.
-
Ravi
MemberApril 14, 2016 at 8:40 am in reply to: Is it possible a multi-level relationship query on Chatter/Comments?Yes,It is possible a multi-level relationship query on Chatter/Comments? Separate the feed from the object to avoid a nested query.
refer this link:http://salesforce.stackexchange.com/questions/4/how-to-do-a-multi-level-relationship-query-on-chatter-comments -
Ravi
MemberApril 14, 2016 at 8:36 am in reply to: How can I create a page with detailed view in Visualforce page?Hi Ajay,
you can use salesforce <apex:detail > component if you are using standard controller.
<apex:page standardController="Account">
<apex:detail subject="{!account.ownerId}" relatedList="false" title="false"/>
</apex:page> -
Ravi
MemberApril 14, 2016 at 8:02 am in reply to: What are the Available formats for report in Salesforce?Hi Ajay,
These ere the Available formats for report in salesforce .
- Tabular
- Summary
- Matrix
- Joined
refer this link for description:
https://help.salesforce.com/HTViewHelpDoc?id=reports_changing_format.htm
-
Ravi
MemberApril 14, 2016 at 7:54 am in reply to: How can I create Email Template from a Salesforce Visualforce page?Hi Ajay,
You can create Visualforce Email Template with custom controller.
reffer this link:
http://www.infallibletechie.com/2013/05/visualforce-email-template-with-custom.html -
Ravi
MemberApril 14, 2016 at 7:49 am in reply to: What is the difference between Static and Dynamic Visualforce Bindings in Salesforce?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.
-
Ravi
MemberApril 13, 2016 at 12:43 pm in reply to: Getting Uncommitted work pending Error in my Test classHi Akash,
Sometimes a developer needs to create a record and then update it with information provided by a Web Service. However, you can't do a web service callout after a DML operation in the same transaction. You should move your batch execution to the inside of the Test.startTest block.
@isTest
private class MyFunTest {
@isTest
static void runTest() {
Account a = new Account(name='foo');
insert a;Test.startTest();
Test.setMock(HttpCalloutMock.class, new MockHttpResponseGenerator());
MyCalloutClass.getInfoFromExternalService();
Test.stopTest();
}
} -
Hi Ajit,
Formula Fields cannot be used with the group by clause in SOQL query
You can check whether a field is "groupable" or not using DescribeFieldResult.
Example:
Schema.DescribeFieldResult resultObject= Object__c.formula__c.getDescribe();
if(resultObject.groupable == true){
formula__c is groupable
}else
formula__c is not groupable- This reply was modified 8 years, 8 months ago by Ravi.
-
Ravi
MemberMarch 29, 2016 at 1:24 pm in reply to: Refresh parent after child action on inline Visualforce PageHi Abhinav,
You can refresh your parent page or a section of parent page using window.opener functionality of java-script.
Example:
ParentPage://function to open a child page(popup)
function popupwindow(){
window.open('child page url');
}
//function to called from child page(popup)
function refreshParent(){
//refresh your page or section of page
}Child Page:
function closeAndRefresh() {window.opener.refreshParent();//call the parent function and that does thetrick
window.top.close();}
- This reply was modified 8 years, 8 months ago by Ravi.
-
Ravi
MemberMarch 23, 2016 at 7:01 am in reply to: Accidently splitting an empty string on some specific character returns a list of size OneSplitting an empty string returns the empty string as the first element. If no delimiter is found in the target string, you will get an array of size 1 that is holding the original string, even if it is empty
Example:
String str =",Utsav"
str.split(',') will return a list of size 2If you split an orange zero times, you have exactly one piece - the orange
- This reply was modified 8 years, 8 months ago by Ravi.
-
Ravi
MemberMarch 22, 2016 at 11:12 am in reply to: How to include stylesheet in visualforce page rendered as pdf ?You're not going to be able to render PDFs properly that were created with Bootstrap. The Flying Saucer Render engine used by Salesforce only supports CSS 2.1 and HTML 4.1.
When you remove render as pdf then bootstrap is available. Also keep in mind that there many css which will not work with renderAs=pdf