Ask Search:
Peter ReidPeter Reid 
User-added image

Hi everyone, I have my fields mapped, email to email for Lead-> Contact and Lead-> account conversion

The field populates after converted on Contact, but it doesn't populate on Account, I've tested several scenarios, why wouldn't the email field get mapped to the Account?

Thanks for any help!
Best Answer chosen by Peter Reid
Patrick SullivanPatrick Sullivan
No, you need to create a second Email field on Lead, then map that to your Account. Since email is already being mapped to Contact Email out of the box, you can't mess with that. So, the lead is going to need a copy of the email field to source the Account Email field. 

Also, why are you putting an email on the Account?
Arpita BoseArpita Bose 
Hi
Can anyone please explain the use of VLOOKUP() function in salesforce with a good example, other than the common ZIP_CODE_c ?
As I am new to salesforce, this function is very confusing for me.

Thanks
Best Answer chosen by Moderator (salesforce.com) 
Deepak AnandDeepak Anand
Hey Arpita,

Forget about the Zip Code example. Lets take an another one for now.

Suppose that you are creating Employee(a custom object) records in the SF org. Now since Employees are very important records, you do not want the users to create duplicate Employee again and again. For example, say one User already created an Employee Record with name - Arpita Bose. Now, an another User who does not know about this tries to create an another Employee record with the same name - Arpita Bose. and hence there is a potential duplication. This should not be allowed. 

So you have two options now:
  1. Add a Validation Rule on the Employee which checks whether there are any existing Employee records with the same name if so stop the User from saving it. Here comes the role of VLOOKUP.
  2. Create an Apex Trigger(before Insert, before Update) which runs a SOQL query to get all the Employee records in the Org with same name as of the one thats getting created now. If the number of records is 1 then stop the User from creating the Employee using an addError method. This will require considerable development effort.
Now, since we are interested in VLOOKUP lets see as of how we can do the same. Create a Validation Rule as below:

(4) Name = VLOOKUP(
(1) $ObjectType.Employee__c.Fields.Name ,  
(2) $ObjectType.Employee__c.Fields.Name ,  
(3) Name)
 

Now, our basic requirement is to check if an another Employee with the same Name exists or not. So its obvious we are looking into the Name field. The logic is quite simple compare the Name (4) on the Current Record and the Name on that Employee record that matched with the same Name as of the one that we are creating now. Hence we use the equality operator (=). 

Lets look into the VLOOKUP side. You could express the VLOOKUP formula as below: "Look into the Name(2) field on all the Employee Records and return value in it's Name (1) field if the it happens to be same as the Name (3) on the Current Record." 

The SFDC Document define VLOOKUP as follows:

VLOOKUP(field_to_return, field_on_lookup_object, lookup_value)
 
Searches an object for a record where the specified field matches the specified lookup_value. If a match is found, returns another specified field value.

Points to Remember:
  1. VLOOKUP only available on Custom Objects. Vote for this idea: https://success.salesforce.com/ideaView?id=08730000000BqPs
  2. VLOOKUP only available in Validation Rules.
  3. VLOOKUP can only be done on the Name fields.
  4. The field_to_return must be an auto number, roll-up summary, lookup relationship, master-detail relationship, checkbox, date, date/time, email, number, percent, phone, picklist, text, text area, or URL field type.
  5. The field_on_lookup_object must be the Record Name field on a custom object.
  6. The field_on_lookup_object and lookup_value must be the same data type.

Hope this helps!

Best Wishes,
Deepak
 




Eric WelshEric Welsh 
Anyone know how I make it mandatory to post a closed lost reason?  Right now we have the closed lost reason set up as a text area.
Best Answer chosen by Eric Welsh
Ines GarciaInes Garcia
Hi Eric, 

You can make a validation rule, something like for example:

AND ( OR ( ISPICKVAL(StageName, "Closed Lost"), ISPICKVAL(StageName, "Closed Refused")), ISBLANK(Closed_Lost_Reason__c) )

That requires Closed_Lost_Reason__c to be filled out when the Stage is Closed Lost or the second one invented :)

Hope this helps, let me know how you get one. Happy Friday! Ines
Barbara KuntzBarbara Kuntz 
I have a workflow in place that notifies owners when a case due date is pushed.  I am tracking the old/new values in case history.  Case owners would like to see both the old AND the new due date.  How can I access or retain the old due date for this purpose?
Best Answer chosen by Barbara Kuntz
Deepak AnandDeepak Anand
I think you will have to capture that in a separate Date Field.

In other words you will have to create a Date Field on the Case called - 
  1. Label: Old Date
  2. Type: Date
And then use a Workflow Rule + Field Update to get that populated - 
  1. Setup | Create | Workflows & Approvals | Workflow Rules
  2. New Rule
  3. Select the Object: Case
  4. Evaluation Criteria: created and every time it's edited [2ND OPTION]
  5. Rule Criteria: formula evaluates to true
  6. Formula
    AND(
        ISCHANGED(Date_Field__c),
        NOT(ISBLANK(Date_Field__c))
    )
  7. Click Save & Next
  8. Under Immediate Workflow Actions, click Add Workflow Action to select Field Update
  9. Select the Field to Update - Old Date
  10. Use the below Formula: 
    PRIORVALUE(Date_Field__c)
  11. Click Save
  12. Hit Done
  13. Activate
That should do it. Now, you can use this field in your Email Templates.
Jill ReganJill Regan 
I have a validation error that runs if:
picklist value = Not Started, blank, or NA
AND the account Country code is not equal to US.

I want this errro to populate only if an opporutnitys business location picklist value = MES or IES
as soon as i enter the 3rd piece of criteria then it does not work

IF(
    AND(
        OR(
           ISPICKVAL(Business_Unit__c,'MES'), 
           ISPICKVAL(Business_Unit__c,'IES'), 
           ISPICKVAL(Country_guidance_policy_checked__c, 'Not Started'),
           ISPICKVAL(Country_guidance_policy_checked__c, ''),
           ISPICKVAL(Country_guidance_policy_checked__c, 'N/A')  
        ),

           NOT(Account.Country_Code__c = 'US')       
    )
    ,true
    ,false
)


 
Best Answer chosen by Jill Regan
Paras BhattParas Bhatt

    AND(
        OR(
           ISPICKVAL(Business_Unit__c,'MES'),
           ISPICKVAL(Business_Unit__c,'IES')
        ),
        OR(
           ISPICKVAL(Country_guidance_policy_checked__c, 'Not Started'),
           ISPICKVAL(Country_guidance_policy_checked__c, ''),
           ISPICKVAL(Country_guidance_policy_checked__c, 'N/A')
        ),
        NOT(Account.Country_Code__c = 'US')
    )


Just Formatted the formula.

Alexandru OancaAlexandru Oanca 
I have the below formula:

IF(
OR(
ISPICKVAL(Owner:User.Region__c, 'USA')
&&
ISPICKVAL(Owner:User.Segment__c,'CAT') ||
ISPICKVAL(Owner:User.Segment__c,'Regional') ||
ISPICKVAL(Owner:User.Segment__c,'National') ||
ISPICKVAL(Owner:User.Segment__c,'Enterprise')
&&
(Signing_Submitted_Date__c > Signing_Effective_Date__c),

NOT(ISPICKVAL(Owner:User.Region__c, 'USA'))
&&
ISPICKVAL(Owner:User.Segment__c,'CAT') ||
ISPICKVAL(Owner:User.Segment__c,'Regional') ||
ISPICKVAL(Owner:User.Segment__c,'National') ||
ISPICKVAL(Owner:User.Segment__c,'Enterprise')
&&
(Signing_Submitted_Date__c > (Signing_Effective_Date__c + 30))
),
"Yes", "No")

And instead of "+ 30" at the end of it I want to use "+ 1 Month"
How can I do this?
Best Answer chosen by Alexandru Oanca
Steve MolisSteve Molis
I don't think you'll be able to do it and get under the Compiled Size limit.

Using the example posted in the Common Date Formulas guide =>

 https://help.salesforce.com/HTViewHelpDoc?id=formula_examples_dates.htm&language=en_US (https://help.salesforce.com/HTViewHelpDoc?id=formula_examples_dates.htm&language=en_US)

Adding months to a date is slightly more complicated as months vary in length and the cycle of months restart with each year. Therefore, a valid day in one month (January 31) might not be valid in another month (February 31). A simple solution is to approximate each month’s length as 365/12 days:
date + ( ( 365 / 12 ) * Number_months )
While this formula is a good estimate, it doesn’t return an exact date. For example, if you add two months to April 30 using this method, the formula will return June 29 instead of June 30. Returning an exact date depends on your organization’s preference. For example, when you add one month to January 31, should it return February 28 (the last day of the next month) or March 2 (30 days after January 31)?
This formula does the following:
Returns March 1 if the future month is a February and the day is greater than 28. This portion of the formula performs the same for both leap and non-leap years.
Returns the first day of the next month if the future month is April, June, September, or November and the day is greater than 30.
Otherwise, it returns the correct date in the future month.
This example formula adds two months to a given date. You can modify the conditions on this formula if you prefer different behaviors for dates at the end of the month.
IF(
  MOD( MONTH( date ) + 2, 12 ) = 2,
  IF(
    DAY( date ) > 28,
    DATE( YEAR( date ) + FLOOR( ( MONTH( date ) + 2 ) / 12 ), 3, 1 ),
    DATE( YEAR( date ) + FLOOR( ( MONTH( date ) + 2 ) / 12 ), 2, DAY( date ) )
  ),
  IF(
    OR(
      MOD( MONTH( date ) + 2, 12 ) = 4,
      MOD( MONTH( date ) + 2, 12 ) = 6,
      MOD( MONTH( date ) + 2, 12 ) = 9,
      MOD( MONTH( date ) + 2, 12 ) = 11
    ),
    IF(
      DAY( date ) > 30,
      DATE( YEAR( date ) + FLOOR( ( MONTH(  date  ) + 2 ) / 12 ),
       MOD( MONTH( date ) + 2, 12 ) + 1, 1 ),
      DATE( YEAR( date ) + FLOOR( ( MONTH( date ) + 2 ) / 12 ),
       MOD( MONTH( date ) + 2, 12), DAY( date ) )
    ),
    IF(
      MOD( MONTH( date ) + 2, 12 ) = 0,
      DATE( YEAR( date ) + FLOOR( ( MONTH( date ) + 2 ) / 12 ) - 1, 12, DAY( date ) ),
      DATE( YEAR( date ) + FLOOR( ( MONTH( date ) + 2 ) / 12 ),
       MOD( MONTH( date ) + 2, 12), DAY( date ) )
    )
  )
)
If you’re using these formulas for expiration dates, you might want to subtract a day from the return value to make sure that some action is completed before the calculated date.
Christina BrunnmeierChristina Brunnmeier 
I keep getting this error message

Error: This component contains unsupported or malformed HTML elements. Remove any script-related tags, fix any malformed HTML, then try again.
Best Answer chosen by Miglena (Salesforce.com) 
Christina BrunnmeierChristina Brunnmeier
Thank you for your response.  I discovered what I was doing wrong. I had F&B as part of the text, once I changed it to F/B it worked
 
Deb LuebchowDeb Luebchow 
My company has a very lengthy disclaimer that has to be on every quote. I'm having problems getting this to display in my quote template. So far, I tried adding a Text/Image field to the quote footer, but the footer doesn't display at all. I know there's a known issue with the way footers are displayed, but I can't get the footer to display at all.

Next, I tried adding a separate section below the quote signature line; then adding a text/image field there, but that section also doesn't display at all on the quote.

What is the best way to accomplish this? I'm confused as to why I can't get the text field to displa at all either in the footer or the separate section I added.

The disclaimer contains 1,947 characters between words and spaces.
Best Answer chosen by Deb Luebchow
Deb LuebchowDeb Luebchow
I figured out what I was doing wrong and got it to to work. Many thanks for your quick response, Ines!
Brandon JensenBrandon Jensen 
Can someone help with this formula.. 
I'd like an alert when any of these fields change when another field isn't blank.. 

AND(  
OR (  
ISCHANGED ( Classification__c ),  
ISCHANGED ( On_Contract__c ),  
ISCHANGED ( Target_Customer__c ),  
ISCHANGED ( Niche_Customer__c ),  
ISCHANGED ( CS_Accepted__c ),  
ISCHANGED ( TickerSymbol ),

OR(  
AND(  
NOT (ISBLANK ( Stitch_ID__c))))))
Best Answer chosen by Brandon Jensen
Deepak AnandDeepak Anand
So like this = 

1. When any of these fields change
OR(
    ISCHANGED(Classification__c),
    ISCHANGED(On_Contract__c),
    ISCHANGED(Target_Customer__c),
    ISCHANGED(Niche_Customer__c),
    ISCHANGED(CS_Accepted__c),
    ISCHANGED(TickerSymbol)
)

2. When another field isn't blank
NOT(ISBLANK(Stitch_ID__c))

Now combine them in an AND - 
AND(
    [1],
    [2]
)

So that yields = 
AND(
    OR(
        ISCHANGED(Classification__c),
        ISCHANGED(On_Contract__c),
        ISCHANGED(Target_Customer__c),
        ISCHANGED(Niche_Customer__c),
        ISCHANGED(CS_Accepted__c),
        ISCHANGED(TickerSymbol)
    ),
    NOT(ISBLANK(Stitch_ID__c))
)
Matt BuczekMatt Buczek 
Hello all,

I have a create this 1 click java button to check and see if 2 fields are null before being able to send an email from a case but it does not seem to be working correctly.

Here is the code I have in place.
{!REQUIRESCRIPT("/soap/ajax/26.0/connection.js")} 
{!REQUIRESCRIPT("/soap/ajax/26.0/apex.js")} 

if(ISBLANK({!Case.Product_Issue__c}) || ({!Case.Issue_Type__c})) { 
alert ("Product Issue or Issue Type is not populated."); 


else{ 

window.open 
https://na42.salesforce.com/_ui/core/email/author/EmailAuthor?retURL=/{!Case.Id}&p3_lkid={!Case.Id}&rtype=003&p2_lkid={!Case.ContactId}&template_id=00X2A000002B80K&p26=customersupport@prismhr.com 
}

This is the error I get.
User-added image

Thanks
Best Answer chosen by Matt Buczek
Paras BhattParas Bhatt

No Worries,

Just Use

 

{!REQUIRESCRIPT("/soap/ajax/26.0/connection.js")} 
{!REQUIRESCRIPT("/soap/ajax/26.0/apex.js")} 



if( {!ISBLANK( TEXT(Case.Product_Issue__c) )} || {!ISBLANK( TEXT(Case.Issue_Type__c) )})

alert ("Product Issue or Issue Type is not populated."); 


else{ 
window.open("https://na42.salesforce.com/_ui/core/email/author/EmailAuthor?retURL=/{!Case.Id}&p3_lkid={!Case.Id}&rtype=003&p2_lkid={!Case.ContactId}&template_id=00X2A000002B80K&p26=customersupport@prismhr.com"); 

}

Just le me know if that works.