We have a custom object A__c whose Name field is an auto number field. Now we have a custom field of Number type, say B__c. The requirement is B__c should be populated with Name-number format for example if the name is 100 which is generated as auto number then B__C should be populated as 100-1 and similarly for next record it should be 101-2.

Seems this is not achievable by auto number field rather would go for trigger?

  • 1
    What happens to B__c if A__c is less than 100? – Chris Jul 28 '15 at 16:21

Hi Saswat you can create a formula field for that as follows:

Name +'-'+ text(VALUE(RIGHT(Name, 1) )+1)

i hope this would be helpfull....

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.