I have a Number field which I want to update using workflow. But since this field has unique option checked so how can I generate unique value in workflow? any thoughts?
Attribution to: doga
Possible Suggestion/Solution #1
We all know very well that salesforce ID is unique and hence you may use formula like 'UNIQ-'+VALUE(Id)
So your external Id will be UNIQ-+salesforceID(18 digit)
Attribution to: Mohith Shrivastava
Possible Suggestion/Solution #2
As you have mentioned in Mohith's answer you can't populate a number field with an Id (or String).
What I would suggest is create an Auto Number field on the Object with the format {0}
(This is a number only format) This will guarantee a unique number for every record. Then you will be able populate your unique number field with the auto number value.
It sounds like the unique number field is not well designed, I would recommend reconsidering why the Number is unique at all.
Attribution to: Daniel Blackhall
This content is remixed from stackoverflow or stackexchange. Please visit https://salesforce.stackexchange.com/questions/4719