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
SambitNayakSambitNayak 

How to include an auto-number in a field

Hi,

I have a requirement where the user wants to see the value of an auto-generated number appended with the name in the same name field.
Example:
User is creating a record and entering value 'ABC' in the name field. Upon saving, the user should see the value 'X-000 ABC' in the name field (X-000 is an auto number in this object).
I used a Record-Triggered Flow but unfortunately it's working only on update (not when the user creates a record).
Any advise or help is highly appreciated.
Aditi Singh 41Aditi Singh 41
Hi Sambit
Auto-generated number fields are not writable, you can modify them. But can create a formula field to show this using a formula field.
SambitNayakSambitNayak
Hi Aditi,
I'm not going to overwrite the auto-generated field. I just want to append this to a field and update the same field.
Example: You entered the field Name__c = 'Aditi'. Upon save, the user should see this field as 'X-001 Aditi'.
I wrote a Flow, but it keeps on appending the name every time I save.
Sarah MeyersSarah Meyers
Hi Sambit, 

Seems like your flow is operating on before-save. Auto-number fields are populated after the record is inserted. In your case, the record is not yet committed to the database, so the auto-number field is not populated. You just need to change flow properties and update them to operate on after saving the records (The screenshot is attached for reference). This should resolve the issue.
User-added image