How to convert a String or Number field to Formula field in Salesforce?

To convert a String or Number field to Formula field in Salesforce, you can do the following workaround.

We cannot convert String or Number field to Formula field in Salesforce.

Workaround: 

1. Create a temporary field and use the temporary field in all the Visual pages, Classes, Triggers, Components, etc. where it is referred.

2. Delete the Number or String field.

3. Create a formula field.

4. Now use the created formula field in all the Visual pages, Classes, Triggers, Components, etc.

Cheers!!!

2 comments:

  1. Hi Sir Good Morning...

    Formula fields are special read-only fields that cannot be converted to any other data type. Likewise, you cannot convert any other field type into a formula field.Can you please provide example for this it will help for us..

    Regards,
    Munna

    ReplyDelete
  2. Example:

    If you have created a text field and later if you want to change this text field to formula field, it is not applicable in Salesforce.

    ReplyDelete