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
MC34MC34 

Auto-number field change via formula?

Hi there, 

I am creating a new custom formula field (text) that will show the specific auto-number why recordtype. I need to change the formatting for autonumber from

MP-0315  to CM-0315 (an example)

Only if RecordType.Id = "xxxxxxxxxxxxxxx"

I have this code: 
IF(RecordType.Id = "xxxxxxxxxxxxxxx", "CM-"+ MID(Name, 3,5),Name)

However, this is not working. Any ideas? 

Thank you. 

Natto
Shunsuke Gimba (銀羽 俊介)Shunsuke Gimba (銀羽 俊介)
IF(RecordType.Id = "0120K0000019oLu", "CM-"+ MID(Name, 3,5),Name)

I tryed what you wrote and it correctly displays 'CM-000'.

・Do you use correct recortype ID? (prod⇔sandbox difference, 15 or 18 digit(15 seems to be correct.))


 
MC34MC34
@Shunsuke - Thanks for reply!

I do not know why this do not work. Well, I have this standard autonumber field Name that is meant for the standard record and this is currently set as MP-xxxx

I want a custom formula field  (text)

NewAutonumber__c that will show the edited Name and show as CM-XXXX. 

How did you test it? did you have standard autonumber field presently that you use this custom formula based on it? 

Natto
MC34MC34
I am testing this in Sandbox. I used the record id of sandbox