function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Greg PalleschiGreg Palleschi 

Duplicating a field using a field formula

My organization has a small problem and we are looking for a solution to fix this issue. On the lead side we collect information in a particular field, and we would like to map this information to both the contact and the opportunity record upon converting.

As far as we are aware, SFDC does not allow duplicate mapping to occur. If I am wrong in this, please let me know and explain how I can make it happen. Our thought is then to create a 2nd custom field with a field formula that looks something like (field2 = field1) so that when we convert we can just map it to 2 locations.

Can anyone shed some light on this, and provide some assistance on how to solve this problem.

KingsleyKingsley
Using the formula definitely seems like the quick way to get it done. I'm not sure if duplicate mapping is possible.
Paul.FoxPaul.Fox
From what I've seen and tested you can't map one lead field to two other fields.  However, it looks like your formula field duplication will work.  You can also leave the field off of the page layout.  The only problem is that it's one more field to clutter the page when you're creating reports. 
Greg PalleschiGreg Palleschi
So my issue is I am not sure how I setup that formula. Is there any existing code that would explain the correct way to go about this?
TonkaCruiserTonkaCruiser

Greg,

To create a duplicate you will need to create a formula field of the same type as the source and then put the mail merge value of the source.  No other code is nessasary unless you want to add more functions to the duplicate.  It would appear like: {!Source_field}

Chris

Message Edited by TonkaCruiser on 10-13-2006 02:46 PM

JNAJNA
I created a field and used the forumla suggested to create a duplicate.  I then when into the lead mapping to map the duplicate field to a field on the opportunity screen and it now gives me this error.
 
Error: Lead field length of 1,300 is greater than this field's length of 50
 
The original lead field is a custom TEXT field that is set to 50.  I cannot set a formula field to any text length.
 
Any ideas?
Paul.FoxPaul.Fox

Suggestions:

  1. Submit length of formula field on ideas.salesforce.com
  2. Use workflow instead of formula fields to map the field to Opportunity.
    • Create a second text field on the Lead with a length of 50 (do not add it to the page layout)
    • Create a workflow rule that runs whenever the Lead is modified (use something like Lead ID not equal to blank)
    • Inside the workflow rule create a field update to update the second text field with the value from the first text field
    • Map the second Lead field to the Opportunity.

Note: You need Enterprise or Unlimited Edition for Workflow.

Greg PalleschiGreg Palleschi
Any idea how to make that work if the originating field is a pick list?
Any idea how to make that work if the originating field is a pick list?
Any idea how to make that work if the originating field is a pick list?
MicaiahFMicaiahF
Hi Greg,

This is a great question, one that many users struggle with.  Paul's suggestion about using work flow field updates is likely the best practice in this situation.  However your objective can be accomplished without the use of work flow rules.

Here is an example formula of how one would capture a set from the Lead:Status picklist values in a formula field;

CASE( Status ,
"Open - Not Contacted","Open - Not Contacted",
"Working - Contacted","Working - Contacted",
"Open- In Approval","Open- In Approval",
"Channel Deal Approved (Converted)", "Channel Deal Approved (Converted)",
"Closed - Converted","Closed - Converted",
"Closed - Not Converted","Closed - Not Converted",
"Closed - Not Converted","Closed - Not Converted",
"Ready to Convert","Ready to Convert",
null)

Since the field type actually being duplicated is a formula field, you are restricted by the formula field character limit of 1300. Then on the receiving end of the field mapping use a Large Text field with a character limit of 1300 or greater. 

This limitation is one reason why the work flow rule is a cleaner solution, as it will allow you to map true field size or even to a picklist on the receiving object.

The work flow rule solution also allows many fields (10) to be updated at once, allowing addional mappings of this field as needed.


PromericPromeric

Thanks Chris. I created an s-control with it and it works. By any chance do you (or anyone else) know how to do some formatting? The field is huge, when all I need is to just display the one word. Is there a way to limit the size of the field or s-control?


TonkaCruiser wrote:

Greg,

To create a duplicate you will need to create a formula field of the same type as the source and then put the mail merge value of the source.  No other code is nessasary unless you want to add more functions to the duplicate.  It would appear like: {!Source_field}

Chris

Message Edited by TonkaCruiser on 10-13-2006 02:46 PM



 

MicaiahFMicaiahF
To make the field smaller one should be able to double click on the s-control field on the page layout edit screen.  Then the option of how many pixels you want it to be should appear.  I believe 18 is the standard size for fields on the page layout.

Hope this helps.

Best,
Micaiah

Message Edited by MicaiahF on 08-29-2007 07:08 AM

Angel118Angel118
Greg,
         Can u tell me how u were able to create the Feild Duplicate S-Control for Lead Mapping
 
Thanks in Advance
MicaiahFMicaiahF
Hi Angel,

I am not sure about the S-Control option.  However when I have been faced with mapping a single lead field to multiple fields on conversion.  I found that a work flow rule that updates a field on the Lead record was the simplest solution.  Once the new field is created, just use field mapping to send the data to it's new home.
TCAdminTCAdmin

Promeric,

You can use the substring(a,b) if you have a set amount of characters you would want to display.

Angel118Angel118
Hi Promeric,
                      I also need to do the same job and got the same error as you got in duoplicating the fields on the Lead.
It says. Error: Lead field length of 1,300 is greater than this field's length of 50

I tried duplicating the Adrees Details on the lead to map them in Contact Also.

If u can help me out,

Thanks inAdvance
Angel
TCAdminTCAdmin
Hello Promeric,

They have done quite a few changes with this.  Currently if a field on the Lead is a formula field it will require the 1,300 characters in the target field.  At the moment the only way around this is to use the workflow rules to populate just the text value in the Lead field.  Then this small value can be mapped to the target field.
lagelage
For this, I typically have either created workflows to populate every time the field is changed or I create an s-control.

- Tanner Shamrock
Carl_V1Carl_V1

Micaiah definitely has the simplest option there, assuming you have Enterprise Edition...

Just create a hidden custom Lead field, map it to wherever you want, and add a workflow rule that works as 'everytime a Lead record is edited, make the <new field> = <field being copied>'. Simple.

Regards,

Carl_V

megmdksmegmdks

Hi there,

I tried using one idea discussed here to duplicate a field from one record type to another.  I used: {!Account.File_Number__c}.  However, I am receiving an error: "Field Account does not exist.  Check spelling."

Any ideas on what I am doing wrong or how I can get around this?  I simply want to take the value of the field on the Account Object and duplicate it on my Custom Object.

Thanks in advance.
Paul.FoxPaul.Fox
megmdks,

Unfortunately, Salesforce doesn't yet support using formula fields accross objects. In order to duplicate a field from a standard object on a custom object you would have to write your own s-control or apex code that would update the field whenever it's changed on the Account.

Paul
cpaynecpayne
Is there a sample s-control code out there to accomplish this?  Say for example, to pull a value from the Contact record and drop it into a custom object field?