Kumar Roopam
IndividualForum Replies Created
-
Kumar
MemberFebruary 5, 2017 at 11:25 am in reply to: Can I load data on my Salesforce Visualforce Page dynamically while scrolling?Hi Ajay,
You can look at the following link:
http://peterknolle.com/infinite-scroll-with-visualforce-remote-objects/
-
Kumar
MemberFebruary 4, 2017 at 7:31 am in reply to: Why should we avoid nested loop in Salesforce Apex controller and how to achieve it?Hi Mohit,
Nested loops should be avoided in Apex controllers because they may slow down the processing of the page or may hit the governing limits for the page.
One easy way, and which gives some nice structure to the code is to make the inner loop a separate function, or minimize using loops altogether.
-
Kumar
MemberFebruary 4, 2017 at 7:19 am in reply to: Error: Only variable references are allowed in dynamic SOQL/SOSL.Hi Vikas,
If you use : in your query, Apex expects a variable. So your query should look like this:
query=’SELECT Id,Name FROM Sobject WHERE Id in’+:allObjIds;
You had your ':' inside the string, hence 'allObjIds' was not being recognized as a variable.
Hope this helps to resolve the error - "Only variable references are allowed in dynamic SOQL/SOSL"
-
Kumar
MemberFebruary 4, 2017 at 7:15 am in reply to: How can we pull a specific directory From Bit bucket in Salesforce?Hi Vikas,
I don't have much knowledge of Bit bucket, but this blog may help.
-
Hi Vikas,
Reverting Working Copy to Most Recent Commit
To revert to a previous commit, ignoring any changes:git reset --hard HEAD
where HEAD is the last commit in your current branch
Reverting The Working Copy to an Older Commit
To revert to a commit that's older than the most recent commit:# Resets index to former commit; replace '56e05fced' with your commit code
git reset 56e05fced# Moves pointer back to previous HEAD
git reset --soft HEAD@{1}git commit -m "Revert to 56e05fced"
# Updates working copy to reflect the new commit
git reset --hard -
Hi Sushant,
S-docs in an free AppExchange app, so you have to first install it in your org.
Then you have to create templates for the document you want to create.
Then just add the S-docs button to the object's page layout and generate the docs.
For more info go to:
http://www.sdocs.com/documentation/
Hope this helps.
-
Kumar
MemberFebruary 2, 2017 at 3:26 pm in reply to: How can we run a particular test method by a different user other than the user which is currently active in salesforce org?Hi Sushant,
Generally, all Apex code runs in system mode, where the permissions and record sharing of the current user are not taken into account. The system method runAs enables you to write test methods that change the user context to an existing user or a new user so that the user’s record sharing is enforced. The runAs method doesn’t enforce user permissions or field-level permissions, only record sharing.
You can use runAs only in test methods. The original system context is started again after all runAs test methods complete.
Refer to this:
-
Kumar
MemberFebruary 2, 2017 at 3:24 pm in reply to: What are inline vf page?what is the use of it?Hi Sushant,
A Visualforce page with attribute standardController with an object name can be referenced inside the page layouts of the object.
For more info, refer to these links:
http://www.infallibletechie.com/2015/05/what-are-inline-visualforce-pages-in.html
http://sfdcsrini.blogspot.in/2014/08/how-to-use-inline-visualforce-page.html
-
Kumar
MemberFebruary 2, 2017 at 3:22 pm in reply to: How can we make a callout using javascript in Visualforce Page?Hi Sushant,
To make a callout (I am assuming rest) from your page, you have to use the http object in your controller.
You can also use scripts available for specific apis and use them in your page's <script>.
Hope this helps.
-
Kumar
MemberJanuary 31, 2017 at 2:00 pm in reply to: How to get GeoCodes from From address using Apex in salesforce?Hi Vikas,
Refer to this code:
<apex:page standardController="Account">
<head>
<script type="text/javascript" src="https://maps.google.com/maps/api/js?sensor=false"></script>
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
<script type="text/javascript">$(document).ready(function() {
var myOptions = {
zoom: 15,
mapTypeId: google.maps.MapTypeId.ROADMAP,
mapTypeControl: false
}var map;
var marker;var geocoder = new google.maps.Geocoder();
var address = "{!Account.BillingStreet}, " + "{!Account.BillingCity}, " + "{!Account.BillingPostalCode}, " + "{!Account.BillingCountry}";var infowindow = new google.maps.InfoWindow({
content: "<b>{!Account.Name}</b><br>{!Account.BillingStreet}<br>{!Account.BillingCity}, {!Account.BillingPostalCode}<br>{!Account.BillingCountry}"
});geocoder.geocode( { address: address}, function(results, status) {
if (status == google.maps.GeocoderStatus.OK && results.length) {
if (status != google.maps.GeocoderStatus.ZERO_RESULTS) {//create map
map = new google.maps.Map(document.getElementById("map"), myOptions);//center map
map.setCenter(results[0].geometry.location);//create marker
marker = new google.maps.Marker({
position: results[0].geometry.location,
map: map,
title: "{!Account.Name}"
});//add listeners
google.maps.event.addListener(marker, 'click', function() {
infowindow.open(map,marker);
});
google.maps.event.addListener(infowindow, 'closeclick', function() {
map.setCenter(marker.getPosition());
});}
} else {
$('#map').css({'height' : '15px'});
$('#map').html("Oops! {!Account.Name}'s billing address could not be found, please make sure the address is correct.");
resizeIframe();
}
});function resizeIframe() {
var me = window.name;
if (me) {
var iframes = parent.document.getElementsByName(me);
if (iframes && iframes.length == 1) {
height = document.body.offsetHeight;
iframes[0].style.height = height + "px";
}
}
}});
</script><style>
#map {
font-family: Arial;
font-size:12px;
line-height:normal !important;
height:250px;
background:transparent;
}
</style></head>
<body>
<div id="map"></div>
</body>
</apex:page>In this page I am getting geocodes for an particular account using the google api geocode method.
Hope this helps.
-
Kumar
MemberJanuary 30, 2017 at 7:40 am in reply to: Advantages of Sites over Salesforce Community?Hi Vikas,
Refer to this documentation link for this:
-
Kumar
MemberJanuary 30, 2017 at 7:37 am in reply to: How to set time limit between queued jobs in Salesforce?Hi Sushant,
You will have to use a helper class which implements schedulable interface to enque queueables like what you have at whatever interval you want to configure using the chron trigger object.
Refer to this post for a detailed solution.
Hope this helps.
-
Kumar
MemberJanuary 30, 2017 at 6:45 am in reply to: What is the difference between Process builder's submit for approval and Approval processes in salesforce?Hi Sushant,
- In Process Builder You submit record for Approval. You need to specify the name of Approval process to which you want to submit the record.
- Approver and other details will be defined on Approval process.
Hope this helps.
-
Kumar
MemberJanuary 30, 2017 at 6:43 am in reply to: What is the Callout Limits within Batch Apex in salesforce?Hi Vikas,
It's per each call of execute() in the batch, so for each "batch", you can call up to 10 HTTP callouts.
If the callout can handle multiple records at a time, do so, and batch up to 10 callouts per batch, otherwise, set the batch scope to 1, so each apex batch handles one record at a time.
Hope this helps.
-
Kumar
MemberJanuary 30, 2017 at 6:38 am in reply to: How many sandboxes can create from production in saleforce ?Hi Rajesh,
It depends on your salesforce org edition.
Enterprise Edition includes licenses for 25 Developer sandboxes and 1 Partial Copy sandbox.
Performance Edition includes licenses for 1 Full sandbox, 5 Developer Pro sandboxes, 100 Developer sandboxes, and 1 Partial Copy sandbox.
Unlimited Edition includes licenses for 1 Full sandbox, 5 Developer Pro sandboxes, and 100 Developer sandboxes and 1 Partial Copy sandbox.
Professional Edition includes licenses for 10 Developer sandboxes. (Change sets aren’t available.)
If you need licenses for more sandboxes, contact Salesforce to order sandboxes for your organization
Hope this helps.
- This reply was modified 7 years, 9 months ago by Kumar.
-
Kumar
MemberJanuary 25, 2017 at 1:14 pm in reply to: How to Bypass validation rules while updating object by apex trigger?You can refer to this blog for this purpose. Hope this helps.
-
Kumar
MemberJanuary 25, 2017 at 12:55 pm in reply to: How to dynamically Add/Delete rows in Salesforce visualforce page?Hi Pranav,
Follow these blog posts:
https://prats23.wordpress.com/2014/04/27/salesforce-dynamically-addingdeleting-rows-in-visualforce/
http://sfdcsrini.blogspot.com/2014/12/adding-and-deleting-rows-dynamically-in.html
Hope this helps.
- This reply was modified 7 years, 10 months ago by Kumar.
-
Kumar
MemberJanuary 25, 2017 at 12:52 pm in reply to: How to track Email status with Salesforce apex code and visualforce page? -
Kumar
MemberJanuary 25, 2017 at 12:42 pm in reply to: How to add background image to Salesforce Lightning component in Community?Hi Tanu,
If you upload you image to a static resource. Yes.
All you need to do is go under the "Branding editor" -> Edit custom CSS and add the appropriate styling. Reference your image accordingly, for example:
body
{background-image: url('https://salesforceDomain/resource/"generatedID"/StaticResourceFile/img.jpg');
background-repeat: no-repeat;
background-size: cover;
background-attachment: fixed;
}VF page:
<apex:image url="{!URLFOR($Resource.FolderName,
'filepath/ImgName.jpg')}" />Hope this helps.
- This reply was modified 7 years, 10 months ago by Kumar.
-
Kumar
MemberJanuary 25, 2017 at 12:38 pm in reply to: How to perform rollback action in Salesforce, once a batch class is processed?Hi Pranav,
I am assuming that you want to rollback the batch process because of some error, in that case:
Unfortunately the platform does not wrap a single Database transaction around the whole job. This is not possible due to the amount of data and length of the jobs (likely Oracles commit log would break internally anyway). So it breaks the job into chunks/scopes determined by a parameter on the Database.executeBatch method (defaults to 200 records). Each of these scopes is passed to your 'execute' method, this represents a single transaction and here you can rollback changes if needed. For more information see the documentation here.
Given the above you have a few options to consider, though the most scalable is to ensure that your job can be re-run incrementally (only for records still not processed via a flag of some kind on the records being processed) once the errors have been addressed. If your data volumes are low enough you might be able to implement your rollback logic in your 'finish' method. You can refer to this post here for more info.
Hope this helps.
-
Kumar
MemberJanuary 25, 2017 at 12:08 pm in reply to: How to show two dashboard snapshots on home page layout in salesforce?Hi Pranav,
Users can customize their home pages. The generic home page will only display a "snapshot" that shows the top row of the dashboard. If you go to Personal Setup > My Personal Information > Change My Display > Home > Customize My Pages (button) > You'll arrive at the settings for Dashboard Snapshot Component. You can then select which Dashboard components you want to have displayed on your home page.
Without creating a custom Visual Force home page that creates a place for you to insert the full dashboard, or creating a Custom Dashboard "Snapshot Component" to replace the standard one, I don't believe there's anyway to do what you're asking. Perhaps others may be able to share other suggestions.
Hope this helps.
-
Kumar
MemberJanuary 25, 2017 at 10:58 am in reply to: In salesforce, what are Remote Object And how can we use Remote object instead of @remote Action in javascript RemotingHi Vikas,
JavaScript remoting is a popular, powerful, and efficient method for building Web apps with Visualforce, especially for creating pages for use in Salesforce1 or working with JavaScript libraries such as jQuery or AngularJS.
Visualforce Remote Objects are proxy objects that enable basic DML operations on sObjects directly from JavaScript.
In your case of using remote objects over remote actions ,remote objects remove some of the complexity from JavaScript remoting by reducing the need for @RemoteAction methods in an Apex controller or extension.
-
Kumar
MemberJanuary 24, 2017 at 1:39 pm in reply to: Can we remove audit fields (like owner ,Last Modified By ) from an object page layout in Salesforce?Hi Sushant,
Yes you can remove the audit fields from an object's page layout.
-
Kumar
MemberJanuary 24, 2017 at 1:33 pm in reply to: Different methods for sending data from a salesforce visualforce page to an apex controller?Hi Sushant,
You can use the <apex:param> tag for this purpose. Refer to this link for more info.
Hope this helps.
-
Kumar
MemberJanuary 24, 2017 at 1:27 pm in reply to: What is Forecasting in salesforce and how does it works?Hi Vikas,
Refer to the following links:
Hope this helps.