Ask Search:
David DavidDavid David 
I know i'm not crazy.  Been on SF classic for 10 years.  The recent items list in the sidebar now puts tasks and all other junk in there where it was always showing me the ACCOUNTS we were at.  What changed?  It has become useless as it fills up with junk I do not need.  People at SF tell me nothing changed???  IMPOSSIBLE!!  Every worker of mine has complained about it and I have no idea what has happened.  ANYONE having this issue and how do we make it go back to how it was...Thanks
Best Answer chosen by David David
Prashant PandeyPrashant Pandey
Hi David,
Unfortunately, you can not customize the recent item..but there is a workaround.
Step 1 : Create a home page component and use this query within the controller and
FROM RecentlyViewed 
WHERE Type IN ('Account')
ORDER BY LastViewedDate DESC

display the account name in the homepage component. 

Step 2:

Go to homepage layout and remove the standard recent item option. 


Step 3: Select the newly created component 
Step 4:
Specify the custom component location within the homepage.


Ashley SistiAshley Sisti 
Hello all,

I need a formula that will correctly calculate the number of months between two dates, assuming that any days less than 1 month would count as 1. 

For the following date fields, it should return:

Contract Start Date:  6/1/2015
Contract End Date: 5/31/2016
12 months

Contract Start Date: 2/12/2015
Contract End Date: 2/11/2020
60 months

Contract Start Date: 7/1/2015
Contract End Date: 7/15/2015
1 month

I've tried several formulas I've seen posted here in the success community, with varying degrees of success. None give me what I'm looking for for all of the scenarios above - I either get 11 months for the 1 year contract, or 59 months for the 5 year. Please help! Thanks!
Best Answer chosen by Ashley Sisti
Paul B. FischerPaul B. Fischer
Can you try this? 
(testdate2__c - testdate1__c) / 365 * 12 < 1, 1, (testdate2__c - testdate1__c) / 365 * 12

I tested it against your scenarios and it should work.

Best regards,
Peter ReidPeter Reid 
Hey everyone, I haven't set up sharing rules/want the best practice before I dive in.

My scenario:  I have multiple companies (from acquisitions) working in the same org.  their records are separated by record type etc.  One issue that comes up, the reps will use the global search and see leads that aren't there's, then they take them and work them.  So in short, these companies (which are all part of my company - they are subsidiaries) are poaching each others leads.  Each company has slightly different business deals they are closing, but in short I want to set something up where if someoen if someone has Profile X, then they can't see specific record types, so then they won't even come up in search.

How can I take care of something like this specifically for Leads and Opportunities.
Lead is set to Public Read/Write/Transfer
Opportunity is set to Public Read/Write

Thanks for any info!
Best Answer chosen by Peter Reid
Amnon KruviAmnon Kruvi
Hi Peter,

If you want leads/opportunities to be invisible to any subset of your org, then you will need to set their OWD (Org Wide Default) to Private. Once you do, you can begin working on who actually does get to see them.

First of all, standard objects always grant access via hierachy. This means that if a user owns a record, then that user's manager also sees that record, and that user's manager, and so on - according to your org's role hierarchy. This can be a great way of making sure your company dirrectors get to see everything that goes on in their company (only).

You may want to set up some ownership-based sharing rules so that other agents in the company can see leads and opportunities owned by agents in the same company. Roles also come into play here.
Chris MatthewsChris Matthews 

It keeps telling me incorrect date format and I can't find it in the help. 

I should be able to have a dynamic date range, correct?
Best Answer chosen by Moderator ( 
Jason ChuJason Chu
Believe you actually want to set it to:

Last Activity equals "LAST 180 DAYS"

Seach for "Special Date Values for Filter Criteria" in help.
Katherine RoweKatherine Rowe 

Ok a basic question on assignment rules.

If you use an assignment rule while creating a lead (whether its created manually, through import wizard, or other tool), every subsequent time you edit anything on the lead, it triggers the assignment rule again? Forever? And if you create lead without an assignment rule, it will never use an assignment rule on it? Ever?

How does salesforce keep track of the ones created with assignment rules in order to remember to run the assignment rule again for every subsequent update? I don't see a field on the Lead object where that information might be stored?

Best Answer chosen by Katherine Rowe
Derek HughesDerek Hughes
I dont think it works like you described.  

Lead assignment rules run differently based on how the lead is created.  
1. Lead import wizards - you get to chose which assingment rule to use, or NONE
2. Through other tools - it will depend on how they are written, but most in my experience cause lead assignment to apply
3. Manually created through the 'New' button on the user interface - this will depend on the page layout properties.  On the properties you can chose if the Lead Assignmen Checkbox should be disaplayed for users to select whether to apply lead assingment rules and whether it should be checked by default.  So you can make it always apply, never apply or leave it up to the user

When leads are edited it is only governed by the page layout properties, but will behave differently for full edit and in-line edits.
1. Full edit - works like a new lead as the checkbox might be visible and then the user can choose, or its always on or always off.
2. Inline edit - the user will never get the option to chose the behaviour as there is nowhere to see the checkbox.  So it may will be that the lead assingment rules run everytime a lead is edited inline.

Finallyyou can setup the lead assingment rule NOT to change the owner based on criteria - so its possible to have a rule that will not assing existing leads, or leads in a certain status and so on.  So even if you have setup the page properties to always run the assingment rules you can control when they will apply.

Hope that helps...

User-added image

Elaine SawfordElaine Sawford 
I'm trying to create a Lookup Rollup summary to coun the number of Opportunities related to a Contact which are not yet confirmed, created this year, at a specific venue and only for specific events. The formula was calculating correctly until I then needed to only include records where the "SG Event Name" value contains "NYE" or "New Years Eve"

I expressed it as per below but it is not calculating correctly so the error must be in the last section. Can anyone offer any tips?

Also, I next need to create a formula to EXCLUDE records where this is the case, so essentially I need records where the SG Event Name DOES NOT CONTAIN "NYE" or "New Year". How would I express DOES NOT CONTAIN in this instance?

Thank you!

RecordType.Name='Shared Christmas Party' AND StageName!='Confirmed - Closed Won' AND CreatedDate= THIS_YEAR AND Venue__c='Battersea Evolution' AND Other_Event__r.Name LIKE '%New Year%' AND Other_Event__r.Name LIKE '%NYE%'
Best Answer chosen by Elaine Sawford
Amnon KruviAmnon Kruvi
Oh, sorry, let's try a slightly different format then:
RecordType.Name='Shared Christmas Party' AND StageName!='Confirmed - Closed Won' AND CreatedDate= THIS_YEAR AND Venue__c='Battersea Evolution' AND (NOT Other_Event__r.Name LIKE '%New Year%' AND NOT Other_Event__r.Name LIKE '%NYE%')

Joseph MiramonJoseph Miramon 
I am trying to set up new users for testing our new app, but just for the sandbox environment. They do not have any current user licenses in the production environment. So, what I did was I created a new user in sandbox, and the new user got a welcome email, but they did not get a prompt to set a new password (like setting up one in production). Thus, they cannot log in.

Do you guys know of a way to just create pure sandbox users without matching what's in production?
Best Answer chosen by Joseph Miramon
Pritam ShekhawatPritam Shekhawat
Yes you can create a new user without adding them into production. The username should follow the same syntax as your other users, which is username.sandbox name. Goto>User detail page and check the checkbox Generate new password and notify user immediately" or you can reset the password for that user.
Nicole SackinNicole Sackin 
I would like to edit the layout of the "Create Lead" page but no matter what I do to the Page Layout it doesn't seem to change what the Create Lead page looks like.  Where can I go to edit this page?
Best Answer chosen by Nicole Sackin
Naval SharmaNaval Sharma
Hi Nicole,

I am afraid that we have the same page layout configuration for the Create/Edit and things can be managed by Field Visibility.
Rob ChoiRob Choi 
Hi All,

As we start to log activities inside an Opportunity, we would like to autofill certain fields.

In an Opportunity, we have a custom lookup field called "Advisor" which ties the Opportunity to the appropriate Contact record.

When I go to create a new task within the Opportunity, there is a lookup field called "Name" which can be either a Contact or a Lead record.

I would like the "Name" field (which will always be a Contact record) to auto populate the "Advisor" field when creating a new task, essentially matching the two fields. 

Is there a workflow for this?  Thanks in advance!
Best Answer chosen by Rob Choi
Deepak AnandDeepak Anand
Here you go:
  1. Go to the Setup | Customize | Activities | Task Buttons, Links & Actions
  2. New Button or Link
  3. Label it as: Create a Call
  4. Display Type: List Button 
  5. Uncheck the option: Display Checkboxes (for Multi-Record Selection)
  6. Behaviour: Display in existing window without sidebar or header
  7. Content Source: URL
  8. URL
  9. Save it

Now, go to any Opportunity record and then:
  1. Hit Edit Layout from top right
  2. Scroll down to the Activity History Related List
  3. Click on the Wedge at the top right corner
  4. Expand Buttons section
  5. Move the newly created "Create a Call" to list of Available Buttons
  6. Uncheck the out of the box = "Log a Call"
  7. Hit Save
That should do it!
Ankita agrawalAnkita agrawal 
private class TestClosingtoOpportunity {

    static testMethod void myUnitTest() {
        // TO DO: implement unit test
        //List<rethink3__Closing__c> CollectionOfClosing = new List<rethink3__Closing__c>();
        Contact con =  [select AccountId from Contact limit 1];
        RecordType rectype = [Select id from RecordType where RecordType.Name =: 'Commercial Deal Sheet'];
        RecordType rect = [Select id from RecordType where RecordType.Name =: 'Residential Rental Deal Sheet'];
        RecordType record = [Select id from RecordType where RecordType.Name =: 'Residential Sale Deal Sheet'];
        RecordType recordtype = [Select id from RecordType where RecordType.Name =: 'Referral Deal Sheet'];
        rethink3__Closing__c sl = new rethink3__Closing__c();
        sl.RecordTypeId = rectype.Id ;//'012E0000000dpZOIAY'
        sl.Name = 'goli-test';
        sl.rethink3__Closing_Status__c = 'Approved';
        sl.s_Commission_Schedule__c = 'Full at Signing';
        sl.s_Tenant_Buyer_Client_1__c = con.Id;
        sl.s_Payment_1__c = 11.11;
        sl.s_Payment_1_Date__c =; 
        insert sl;
        rethink3__Closing__c cls = new rethink3__Closing__c();
        cls.RecordTypeId = rect.Id;//'012E0000000dpZYIAY';
        cls.Name = 'moli-test';
        cls.rethink3__Closing_Status__c = 'Approved';
        //cls.s_Commission_Schedule__c = 'Full at Signing';
        cls.Commission_Paid_By__c ='OP';
        //Contact con =  [select id from Contact limit 1];
        cls.s_Tenant_Buyer_Client_1__c = con.Id;
        cls.s_OP_Commission__c = 4.00;
        cls.s_Payment_1__c = 11.11;
        cls.s_Payment_1_Date__c =;
        insert cls;
        rethink3__Closing__c close = new rethink3__Closing__c();
        close .RecordTypeId = rect.Id;//'012E0000000dpZYIAY';
        close .Name = 'mani-test';
        close .rethink3__Closing_Status__c = 'Approved';
        //cls.s_Commission_Schedule__c = 'Full at Signing';
        close .Commission_Paid_By__c ='Client';
        //Contact conc =  [select id from Contact limit 1];
        close.s_Client_Commission__c = 5.00;
        close .s_Tenant_Buyer_Client_1__c = con.Id;
        close .s_Payment_1__c = 11.11;
        close .s_Payment_1_Date__c =;
        insert close ;
        rethink3__Closing__c closes= new rethink3__Closing__c();
        closes.rethink3__Closing_Status__c = 'Approved';
        closes.RecordTypeId = rect.Id;//'012E0000000dpZYIAY';
        closes.Commission_Paid_By__c = 'Both';
        closes.s_Client_Commission__c = 5.00;
        closes.s_OP_Commission__c = 4.00;
        closes.Name = 'chunnu-test';
        closes.s_Tenant_Buyer_Client_1__c = con.Id;
        closes.s_Payment_1__c = 11.11;
        closes.s_Payment_1_Date__c =;
        insert closes;
        rethink3__Closing__c BuyerCls = new rethink3__Closing__c();
        BuyerCls.rethink3__Closing_Status__c = 'Approved';
        BuyerCls.RecordTypeId = record.Id;//'012E0000000dpZdIAI';
        BuyerCls.Commission_Paid_By__c = 'Buyer';
        BuyerCls.s_Total_Commission__c = 5.00;
        BuyerCls.Name = 'salman-test';
        BuyerCls.s_Tenant_Buyer_Client_1__c = con.Id;
        BuyerCls.s_Payment_1__c = 11.11;
        BuyerCls.s_Payment_1_Date__c =;
        insert BuyerCls;
        rethink3__Closing__c referalcls = new rethink3__Closing__c();
        referalcls.rethink3__Closing_Status__c = 'Approved';
        referalcls.RecordTypeId = recordtype.Id;//'012E0000000dpZTIAY';
        //referalcls.Commission_Paid_By__c = 'Buyer';
        referalcls.s_Total_Commission__c = 5.00;
        referalcls.Name = 'arjun-test';
        referalcls.s_Tenant_Buyer_Client_1__c = con.Id;
        referalcls.s_Payment_1__c = 11.11;
        referalcls.s_Payment_1_Date__c =;
        insert referalcls;
     if(sl.rethink3__Closing_Status__c == 'Approved')          
        if(sl.RecordTypeId == rectype.Id)//Commercial Deal Sheet
         if(sl.s_Commission_Schedule__c =='Full at Signing')
               rethink3__Closing__c closing = sl;
               closing.Buyer_Attorney_Phone__c = '4444';
               update closing;
        if(cls.RecordTypeId == rect.Id)//Residential Rental Deal Sheet
          if(cls.Commission_Paid_By__c =='OP')
               rethink3__Closing__c closing = cls;
               closing.Buyer_Attorney_Phone__c = '4444';
               update closing;
           if(close.Commission_Paid_By__c =='Client')
               rethink3__Closing__c closing = close;
               closing.Buyer_Attorney_Phone__c = '4444';
               update closing;
           if(closes.Commission_Paid_By__c =='Both')
                   rethink3__Closing__c closing = closes;
                   closing.Buyer_Attorney_Phone__c = '4444';
                   update closing;
          if(BuyerCls.RecordTypeId == record.Id)//Residential Sale Deal Sheet
               if(BuyerCls.Commission_Paid_By__c =='Buyer')
                      rethink3__Closing__c closing = BuyerCls;
                      closing.Buyer_Attorney_Phone__c = '4444';
                      update closing;  
          if(referalcls.RecordTypeId == recordtype.Id) //Referral Deal Sheet
               rethink3__Closing__c closing = referalcls;
               closing.Buyer_Attorney_Phone__c = '4444';
               update closing;
This is my test class. I m getting limitexception error in this. please help me with this. :') its urgent.
Best Answer chosen by Ankita agrawal
David LiuDavid Liu
Hey Ankita,

Here are some tips that will improve your code and boost your stock on the Salesforce job market!

1. Avoid using Seealldata=true if possible.  It's better to just create these records from scratch in your Test Class.  This is not only a good Salesforce practice, but also a good coding practice in general.  Plus, you'll save on SOQL queries.

2. Combine your SOQL queries - for example, you could have done this instead:
List<RecordType> recordTypes = [SELECT Id FROM RecordType WHERE Name IN ('Commercial Deal Sheet', 'Residential Rental Deal Sheet', 'Residential Sale Deal Sheet', 'Referral Deal Sheet')];

3. Combine your DML statements by using update on a list instead of individual records.  All SOQL queries from your triggers will fire with each update statement, which is causing you to hit your limit.  It looks like in this case you might need to use each update call, so check out tip #4

4. Separate your test class into multiple test classes.  This is the easiest way to get by governor limits in test classes - just split your test class in half and make it into two separate test classes.  You'll get double the governor limits!

5. Use Test.startTest() and Test.stopTest().  You can do all your queries in the beginning of your class, then do all your updates inside Test.startTest() and Test.stopTest().  You get a fresh set of governor limits inside these too!

"Any code that executes after the call to startTest and before stopTest is assigned a new set of governor limits."

Hope this helps  =)  Your code is great already, but like all code, it can be improved!