A simple request. I am customising an opportunities object page layout and want to show a UID type value that staff can quote to people.

I have this working currently with an auto number field but that can't appear when the new record is being created, it only appears once editing the record.

So is there a way around this and also is it possible without workflows ?

  • Do you want to show this auto number field on the opportunity standard edit layout when user clicks on the new opportunity button? Just to confirm.
    – javanoob
    Feb 19, 2016 at 3:24

1 Answer 1


Here's an option I can think of.. not a straight forward one thou.. (and there might be an easier option that i can't think of)

  1. Create a Custom Setting (hierarchy) with a Number field and start with a base value

enter image description here

  1. Create a New Custom Number Field on Opportunity and set its default value to read from the Custom Setting field.

  2. You can mark the field as Read-only in the page layout and it will show up in the New Opportunity page in read only mode. enter image description here

  3. Create a Trigger on Opportunity to update this custom setting Number field to next available unique number every time a new Opp is created.

  • But OP wants the auto number field to have its value before it hits the database(something like user clicks on the new button and the number should be there) or am I missing something in your solution?
    – javanoob
    Feb 19, 2016 at 3:18
  • yup. the trigger in step 2 will create the next available auto number and stores it in the custom setting. so when you click new opportunity you are directly displaying it from the custom setting. Feb 19, 2016 at 3:44
  • But the trigger won't fire until user clicks on the save button right? I think OP wants the auto number to show the moment user clicks on the new button(which is what I am guessing from OP question).
    – javanoob
    Feb 19, 2016 at 3:45
  • U start with a base number in the custom setting. the 1st opp you create will show u the base number, once the opp is created, the trigger will increment the number in custom setting. so the next opp will show the new value.. does that help ? Feb 19, 2016 at 4:13
  • Now I got the picture but I guess read only fields don't show up when user clicks on the New Opportunity button right?
    – javanoob
    Feb 19, 2016 at 4:18

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .