• Anup Jadhav
  • 739 Points
  • Member since 2009
  • Technical Architect


  • Chatter
  • 20
    Best Answers
  • 0
    Likes Received
  • 5
    Likes Given
  • 4
  • 296
Custom Tabs 
Help for this Page
You can create new custom tabs to extend Salesforce functionality or to build new application functionality. 

Custom Object Tabs look and behave like the standard tabs provided with Salesforce. Web Tabs allow you to embed external web applications and content within the Salesforce window. Visualforce Tabs allow you to embed Visualforce Pages. Lightning Component tabs allow you to add Lightning Components to the navigation menu in Salesforce1. Lightning Page tabs allow you to add Lightning Pages to the navigation menu in Salesforce1.

I want to create a Custom Lightning component tab .
But the feature is missing though it is described in the help section.User-added image
Hi Evrybody,
      I want to know about what is web services,Email Services and API
So can anyone give me the sample example for all those I mentioned above....
Give me the video tutorial for all If possible

Please Help

i not understanding usage of junction object .

Please explain usage and how to create junction object with a example

Hi people, 


I'm setting up Partner Portal for my company and I'm running into lot of questions. We have two profiles 'Manager' and 'Agent'.

Manager users can assign leads to themselves and also to agents if desired but Agent users can assign leads just to themselves. 

Manager users can see all the leads but Agent users can see unassigned leads or just the leads assigned to them.


Can you please help me with the security settings for this.


Right now, I made org wide default settings private for Lead object. And I gave sharing rules between Manager and Agent. But it doesn't seem to be good enough.


Thank you,



Hi everyone, I'm new to the world of apex and such and I'm working on my first test class.  So far I have managed to get most of the code working, but now I'm stuck, and no amount of googling is solving the problem, so any input would be appreciated, I'm sure this is an easy fix for people here.


I'm getting this error in Eclipse: "Invalid Initial Expression Type for Field Quote.OpportunityID, Expecting: Id."  It is coming from this block of code:


Quote quo = new Quote

            (Name = 'Superstar', OpportunityID = [SELECT Id FROM Opportunity WHERE Name = 'WillitBlend']);

         insert quo;


I'm at a loss.  Any input would be helpful.  Here's the rest of the code if that would help any:



private class PFIFillTest {


    static testMethod void myUnitTest() {

    Account acc = newAccount

    (Name = 'TestCo');

    insert acc;

         Opportunity opp = newOpportunity

            (Name = 'WillitBlend', Account = [SELECT Id, Name FROM Account Where Name = 'TestCo'], 

            StageName = 'Proposal/Price Quote', CloseDate = Date.today(),

            ForecastCategoryName = 'Best Case');

         insert opp;

         Quote quo = new Quote

            (Name = 'Superstar', OpportunityID = [SELECT Id FROM Opportunity WHERE Name = 'WillitBlend']);

         insert quo;

         QuoteLineItem qli = newQuoteLineItem

         (UnitPrice = 2500, Quantity = 1, Description = 'Wahoo');

         insert qli;


       update qli;


qli = [SELECT id, Project_For_Invoicing__c FROM QuoteLineItem WHERE Description = 'Wahoo'];

       system.assert(qli.Project_For_Invoicing__c != null);



  • June 20, 2012
  • Like
  • 0

If I have a subclass that overrides a method in a superclass, do I have to cast a reference to get the more specific reference.  The superclass is virtual, not abstract as it has to implement some logic.


Example class definition--


public virtual class MySuperClass {
  public virtual boolean myMethod () {
     // code goes here
     return result;


public class MySubClass {
  public override boolean myMethod () {
     // code goes here
     return result;


 Example call --


MySuperClass myObj = new MySubClass();

// Does this call MySuperClass.validate() or MySubClass.validte() ?
Boolean result = myObj.myMethod();

// Do I have to do this to call MySubClass.validate() ?
Boolean result = (myObj(MySubClass)).myMethod();



I Integrated Sms Magic Application in to my salesforce..when ever we share something in chatter the sms will go to the group members(chatter) their mobilephones

  • June 20, 2012
  • Like
  • 0

this error: 


Error: Compile Error: Variable userInfo is used before it is declared. at line 62 column 42


on the following line


string platformUsername =
[select Platform_Username__c from User where id = :UserInfo.getUserId()].Platform_Username__c;


Do I have to declare UserInfo?  If so, how?






I need a query which returns the list of records whose lastmodifieddate falls in now() minus 2 mins


List<Object> reclist = [Select id from Object where LastModifiedDate =???];




I imagine this is pretty basic, but I haven't seen any code posted here to calculate the median of a list of numbers.  Here's mine, which could pretty easily be adapted to most uses:


List<Integer> testvalues = 
   new List<Integer>();
Double Middle;


decimal sizeOfList = testvalues.size();
system.debug('size of list is '+ sizeOfList);
Middle = sizeOfList.divide(2,1);
system.debug('middle of list is ' + Middle);
system.debug('minimum value is ' + testvalues[0]);
system.debug('max value is ' + testvalues[testvalues.size()-1]);
//Calculate median
	if (middle <> middle.round()) {
		system.debug('median is '+ testvalues[middle.intValue()]);
		else {
		decimal lowMedianValue = testvalues[middle.intValue()-1];
		decimal highMedianValue = testvalues[middle.intValue()];
		decimal Median = (lowMedianValue + highMedianValue)/2;
		system.debug('median value is ' + Median);

 I hope that makes someone's day easier.


Hi,How to Create a records by Eclipse(IDE) in salesforce...........


i.e, iam creating a record in Eclipse than automatically ....thus record should created in my Salesforce ...how can i achieve this....



If anyone know's....reply me.....ASAP

  • May 31, 2012
  • Like
  • 0

Hi , 


i created a Custom Object "Photo" i am saving photo in attctment of this obj. by using formula filed filed i am populating url of image but i want to pass Hieght and widh for image in this url ... i think this is not passible in formula field 


'https://c.cs6.content.force.com/servlet/servlet.FileDownload?file=' + Photo_ID__c . Photo_ID__c  is field which is calculating ID of PHOTO obj by Trigger.


is there any way to calculate url with hieght and width ..



thank you !!

Hi Folks


I have an issue


date d = system.today().addDays(-2);
String strQuery='Select Id,Collection_Center_Code__c,RMA_Number__c,Case.Contact.Name,Contact.Email,SC_Received_Num_Boxes_WDE__c,SCReceivedPalleteID_WDE__c,SCReceivedTracking_WDE__c, SCReceivedTime_WDE__c,SCShipToWDDate_WDE__c,(Select Id,Received_Date__c From Order_Status__r where received_date__c > :d and received_date__c = null ) From Case t Where Collection_Center_Code__c =\''+Code+'\'';


the date variable is coming as d instead of value when i check in debug logs 


can some one help me with this 



Hello, everyone

I’m playing with UI and Visual Force.

Does anyone know if there is way of accessing default SF CSS used for standard layout and altering that file instead of creating everything from zero?


Good day, 


I always have problem to create test method :(


May i know how can we do the test method for below method 



public static void myMethod(List<String> tempCampaignIDList){
		List<Campaign> campaignList = [SELECT Id, Type FROM Campaign WHERE id IN :tempCampaignIDList];
	for(Campaign cp : campaignList){
			CampaignVehicleLookupMap.put(cp.id, cp.type);

Thanks in advance !



  • April 21, 2011
  • Like
  • 0

Can someone please explain the standard way to update a custom object from an APEX class?





I'm wondering if it is possible to do write SOQL that allows me to group by the year of a date-time value within an object.


I've simplified it for my posting here, but basically I've got a custom object Sale__c with two fields


Number(10,2)  AmountOfSale__c

DateTime         DateOfSale__c


I'd love to be able to do a SOQL query like the following:


[Select Year(DateOfSale__c) YearOfSale,

              SUM(AmountOfSale__c) TotalAmountOfSale

 from Sale__c s

 group by Year(DateOfSale__c)]


Something like this wouldn't work directly.  So then I thought about adding a formula field to the object that tried to get the year of the date of sale, but that didn't work either.  (As I get an error message that the formula field can't be grouped on. 


Obviously if I need to I can have the totalling done within Apex, and not the SOQL query, but I'd much rather have it done by SOQL instead so I wanted to see if anyone has any guidence or suggestions here.






Hi  Important is it for a developer to know the governer limits . I know is it important but is it really needed ?



  • August 12, 2009
  • Like
  • 0

(1) Are VisualForce controller classes instantiated by the platform anew for multiple HTTP requests (of, say, the same page), or are they instantiated once for a user's entire session?


(2) If Page A uses controller class X, and Page B uses controller class X also, and a button on Page A performs logic and then navigates to Page B, is the same controller class instance of X used for both the "inbound" (from the user) Page A action and "outbound" (to the user) Page B rendering?





  • August 02, 2009
  • Like
  • 0

If we implement Single Sign On in an organisation using federation authentication will the Outlook client work with this new setup?


Addendum: will other desktop/mobile clients work ?


Thanks in advance!


- Anup



Hello SF developers,


We are integrating salesforce with a java service by exposing Apex methods as webservices.

If they call this Apex webservice, and Salesforce is down for maintenance, what would they expect as a response. 


Is it 503(Service not available)? or is it a custom error message? or is it 404?


Thanks in advance!




Hi all,


We have a requirement to create an xml file in Apex, and store the file on an external server. Creating an xml file is a no-brainer, but I haven't figured out if it IS possible in Apex(and on Force.com platform) to store the file to a folder on an external server.  I do not wish to create an external webservice(in Java or C#) if possible.


Any advice on implementation will be greatly appreciated.


Thanks in advance!


- A J

Hello all,


I have a very specific requirement for merging two accounts.


I have the master account object, and the merge account object. I'd like to redirect the user directly to the step2 of the 'Merge Account Wizard'.


Does anyone out there know the url query variables to be set to accomplish this task?


Thanks in Advance!


- A J



I can not enter values in custom fields for a new Lead by REST api.
I'm using the library jsforce (https://jsforce.github.io/). Salesforce API Library for JavaScript applications.

jf.sobject("Lead").create({Data_de_instala_o__c: form.interesse}, function(err, ret) {
     if (err) { 
         getError(res, err, 500) 

I get the error:
message:"No such column 'Data_de_instala_o__c' on sobject of type Lead"
Could anyone help me to insert the values for custom fields?

Code Coverage is not increasing after writing test classes. The test methods have been passed but code coverage remains 0%  for all the test classes. This is a new issue we are facing (possibly) since the Winter 16 release. Has anyone faced the same issue?
Has anyone else come up with a solution by Trigger for this? I have been trying to figure this out for a few weeks now but to no avail.

for e.g
Amount - 200$
Amount in words - Two hundred Dollar only.

I found apex class from this website http://http://salesforcewithkiran.blogspot.in/2013/05/number-to-words-in-apex.html

that works fine for apex class but not for apex trigger.

and I found another site https://sites.google.com/a/forcegenie.com/kb/home/numberstowords/7-ways-to-integrate-with-your-salesforce-org/continouos-conversion-from-number-currency-to-text-using-a-trigger with trigger program to convert but they calling a NumbersToWords apex class but there is no code for that class.

Need a Trigger to convert numbers/currency to words

Anyone have idea about this?

I am trying to do a one way sync from Quote to opportunity(Line Items included, standard and custom fields also). I have created triggers on opportunity and opportunity line item for the same. When 'Sync Quote' button is clicked from quote page it calls opportunity trigger and in the background quote trigger is called. In opportunity trigger I update line items also which then gives and error

Apex trigger IS_OpportunityTrigger caused an unexpected exception, contact your administrator: IS_OpportunityTrigger: execution of BeforeUpdate

caused by: System.DmlException: Update failed. First exception on row 0 with id 00kq0000002du0uAAA; first error: SELF_REFERENCE_FROM_TRIGGER, Object (id = 006q0000005Lw5i) is currently in trigger IS_OpportunityTrigger, therefore it cannot recursively update itself: []: Class.IS_OpportunityTriggerHandler.syncQuoteAndOpportunityCustomFields: line 302, column 1

I want to know in what order triggers are called on opportunity, opportunity Line items, quote and quoteLineItems? I have also observed that sometimes line items are deleted and new ones created and sometimes it updates the existing line item. How does salesforce determine which action has to be performed in this sync process?
We are using Flow to create cases, we need to assign these cases to different queues. Since FLows do no trigger Assignment rules, what other functionality can I use to make this happen without having to use code?
I can't figure out this error. It only happens on the 3 triggers I have created on Opportunities that send emails. It always points to the "Messaging.sendEmail(emails);" line. These triggers worked before, and then I installed the NPSP 3.0 and this error started appearing. NPSP says it has nothing to do with them, which is fine, I just know that's the only thing we changed. We need to keep NPSP 3.0 because we were having different errors with 2.0.

Here is the full error

Upsert failed. First exception on row 0; first error: CANNOT_INSERT_UPDATE_ACTIVATE_ENTITY, ClientCare_TeamTrainingFundingReceived: execution of AfterInsert

caused by: System.EmailException: SendEmail failed. First exception on row 0; first error: INVALID_FIELD_FOR_INSERT_UPDATE, Task: bad field names on insert/update call: ActivityOriginType: [ActivityOriginType]

Trigger.ClientCare_TeamTrainingFundingReceived: line 148, column 1: []

  • October 22, 2015
  • Like
  • 0

Can someone please explain to me, how I can quickly and easliy integrate ALexa ranknig with Salesforce?

So basically when I pull up an account, it will show updated ALexa ranking in one of the fileds from that acounts website.

Is this possible???

What is the best way to have leads be sent out to partners through an XML post (standard lead fields)?
Ever since we were upgraded to Winter '16, our Accounts integration has been experiencing this issue :

Unable to connect to Salesforce.com after 5 attempts.
Error is: java.net.SocketTimeoutException: Read timed out.

Are there any known performance issues with integration processing on Winter '16? This integration has been working fine for 5 years, and now all of a sudden we are experiencing this issue frequently. Sometimes only 1 batch of 200 upserts will process OK, and then with the next execution 2-3 batches will process successfully before failing on the issue above.

We have the integration connecting to :


Is there a newer API level we should be logging in to?
Thanks for any ideas or thoughts concerning this recent problem.

Miki Tosic
Life Fitness
Right now when sending Vertical Response emails not only does it show up in the Vertical Response section (where it should) but it also shows up in the activity history and logs and activity for each contact attached to an account. I know it is possible to create an apex code to prevent this from happening. 

Basically, I need a code that will not push the mass email to the activity history. Any suggestions?? 

I am looking for a function in any of the APIs (Probably Metadata API), that could help me get references on a field. E.g used in apex, another field etc.

Just like the way when you try to delete a field and it gives you the reference list.


I am facing issue of too many redirects for 1 of my users.
The respective page is embedded on Home page. No other people can see this error except 1 user.
I don't know what to do about that.
Can anyone please help?
I have a setController where I'm using a database.queryLocator entering a query string that ends with a LIMIT clause under 10000. 

When I set the LIMIT clause in the query string, the setCon.getCompleteResult() method reports as TRUE - that is all the records were found. The problem is that we have over 10000 records of this object, so I would expect the setController response to be FALSE. 

If I remove the LIMIT clause in the query string, the system returns a too many rows error. 

I don't see any examples on the board, in the documentation, or anywhere else where the getCompleteResult() method on the setController is used in a situation where there are too many records in the database, so I don't see when the getCompleteresult() method would ever return a value of FALSE. If you add a LIMIT clause to the query, getCompleteResult() says I got all the records, which I know isn't true. If I don't, I get the query error. 

// this is supposed to tell the user that the result is incomplete and to apply a filter
public boolean resultComplete {get; set;}

public ApexPages.StandardSetController SetCon {
        get {
            if(SetCon == null) {
                System.debug('SetCon is null; loading');
                String query = getQuery();   //returns query string ending with 'LIMIT 5000'
                SetCon = new ApexPages.StandardSetController(Database.getQueryLocator(query));

            numAvailableLogs = setCon.getResultSize(); // this = 5000
            System.debug('numAvailableLogs is '+numAvailableLogs);

            numPages = (math.mod(numAvailableLogs,pageSize) == 0)? (numAvailableLogs/pageSize) : ((numAvailableLogs/pageSize)+1); 

            resultComplete = setCon.getCompleteResult(); // this returns true (there are more records)
            System.debug('setCon resultComplete is '+resultComplete);

            hasNext = setCon.getHasNext();
            hasPrevious = setCon.getHasPrevious();
            pageNumber = setCon.getPageNumber();
            return SetCon;

We can modify the Permission Sets using Apex in our Development org.
But can we change the Permission set by writing code in the Post Install Script after package Installation without cloning Permission sets ?
The below query is being used by offshore team in Mulesoft to query IsDeleted Campaign Members for specific Campaign ID. When tested in Developer console it seems to work but via API Integration pulling query in Mule (for ExactTarget) they are not returning expected results for specific Campaign (only one deleted/removed campaign member where there should be several over period of time). Need to find out how to trouble shoot or come up with better query.  Objective: To provide ExactTarget updated Campaign Members every 30 minutes (New Campaign Member add query does appear to be working).

select Campaign.ET_Activity_ID__c,CampaignId,Id,ContactId,Contact.Email,Contact.FirstName,Contact.LastName,Campaign_Member_Source__c, IsDeleted,LastModifiedDate,LeadId,Lead.LeadSource,Status from CAMPAIGNMEMBER where IsDeleted=true

Any assistance greatly appreciated.
Has any worked on bar code generation , i have a requirement to convert the text to pdf417 barcode font and then send the font to third party app for bar code generation.
  • October 12, 2015
  • Like
  • 0
How to know the date format of the user in salesforce. Basically I want to perform some operation based on user's date format.
If(date_format == dd/mm/yyyy) 
{ do this } 
if(date_format == mm/dd//yyyy) 
​{ do this }

I know we can use Map to store the locale as key and date format as values and then query the locale and get the date format, but it is very lengthy and it will also increase the no. of lines in code.

When usiing the Eclipse IDE Force.com plugin, and you do 'New Apex Class", you can choose from three templates:


  • Default
  • Test_Class
  • Inbound_Email_Service


How do I add to this list with my own templates?  There is no templates option in Eclipse 3.6 Window | Preferences |<search on template> within the Force.com section


I can see that the aforementioned templates live in this path on my (Windows XP) machine:

C:\eclipse\configuration\org.eclipse.osgi\bundles\812\1\.cp\templates ..


and I can add a template in that folder and it will appear as a choice -- yet this doesn't seem like the right way to do this


Using IDE  version 20

Hi awesome people,

Our client has a mulesoft job using Bulk API. It queries first a total of 200,000 records and then hard deletes it. However starting Oct. 17, the maximum number of records being queried by the job is now only 2,000 though in MuleSoft it is still 200K. I'm suspecting it has something to do with the Winter '16 update last oct. 17 in AP1 instances. However I can't find any significant documentation supporting this theory as of now.

Can you shed some light here? Thanks!
  • October 22, 2015
  • Like
  • 1
Is there any Template Engine like FreeMaker(in Java) which can be used to generate XML or JSON based on Changing data? I am looking for this feature so that I dont have to hardcode the XML structure in my Apex code, instead I will be creating a template and the engine will be able to take the required dataMap as an input along with the template (Static Resource) and will create the XML dynamically. This will enable me to create XMLs without any further coding even if I have any change in the XML template/structure.
I have been into Microsoft Technologies for more than a decade and would like pursue my interest on Salesforce.

Just wondering where should I start from and the career opportunities available

I have just created Salesforce login

Today we’re excited to announce the new Salesforce Developers Discussion Forums. We’ve listened to your feedback on how we can improve the forums.  With Chatter Answers, built on the Salesforce1 Platform, we were able to implement an entirely new experience, integrated with the rest of the Salesforce Developers site.  By the way, it’s also mobile-friendly.

We’ve migrated all the existing data, including user accounts. You can use the same Salesforce account you’ve always used to login right away.  You’ll also have a great new user profile page that will highlight your community activity.  Kudos have been replaced by “liking” a post instead and you’ll now be able to filter solved vs unsolved posts.

This is, of course, only the beginning  and because it’s built on the Salesforce1 Platform, we’re going to be able to bring you more features faster than ever before.  Be sure to share any feedback, ideas, or questions you have on this forum post.

Hats off to our development team who has been working tirelessly over the past few months to bring this new experience to our community. And thanks to each of you for helping to build one of the most vibrant and collaborative developer communities ever.