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
KULWANT SINGHKULWANT SINGH 

append picklist value to name field

hi,,i want to append picklist value to the name field of custom object....like custom obj name "abcdef" and picklist value is '10' and i want  to show it like as below using workflow rule
'abcdef 10'.....how it can be done??????
Best Answer chosen by KULWANT SINGH
Jayson Faderanga 14Jayson Faderanga 14
Hi Kulwant,

I see I understand, alright follow this step.

1. Click "Setup" on the upper right hand corner
2. on the left hand column search for "Workflow Rules", it is located under Setup > App Setup > Create > Workflow & Approvals > Workflow Rules
3. Click "New Rule"
4. Select the Custom Object and click Next
5. Put a Rule Name, i.e Naming Convention
6. select "created, and every time it’s edited"
7. on the Rule Criteria section, on the first drop down, look for the picklist field "number" then for the operator select "not equal to" then leave the value (empty) or blank then click on Save & Next.
8. on the next page, click on "Add Workflow Action" select "New Field Update" on the dropdown.
9. put a name for your field update, i.e name automation
10. on the "Field to Update dropdown", look for the custom object name field, "name" (then wait for second, option will show up)
11. select the radio button "Use a formula to set the new value"
12. then click on "Show Formula Editor"
13. click on Insert field button
14. on the second box, look for the custom object name field, "name"
15. then click "Insert" (shows up on the third box), 
16. then click on Insert Operator button, on the drop down look for Concatenate, this is the ampersand symbol "&"
17. then put this " " (quote space quote), then click on the insert operator button again and select concatenate
18. then type the word TEXT( 
19. yes, you need to include the open parenthesis, then click on Insert Field again, then look for the picklist field "number" in the second box then click insert
20. put a close parenthesis, once done, it should look like this

name__c & " " & TEXT(number__c)

21. click Save, then click "Done" on the upper right hand corner
22. then click "Activate"
23. You're done, you can test it out :)

hope this helps, I tried to be as detailed as possible, just let us know if you have questions. Thanks!

All Answers

James LoghryJames Loghry
You can use either a workflow rule and field update, a process, or a trigger to update the Name field.  Be careful though, as you'll want to check if the picklist value has already been appended.
Jayson Faderanga 14Jayson Faderanga 14
it is possible...after you created the rule, add a field update and use the below syntax for your formula.

Custom_Object_Name__c & " " & TEXT(Picklist_field__c)

Hope that helps :)
 
KULWANT SINGHKULWANT SINGH
actually i am new to SF ,,,and i could not find the exact formula for this...can you please elaborate more on this....
................
custom object name field is 'name' and picklist name 'number' 
Jayson Faderanga 14Jayson Faderanga 14
Hi Kulwant,

I see I understand, alright follow this step.

1. Click "Setup" on the upper right hand corner
2. on the left hand column search for "Workflow Rules", it is located under Setup > App Setup > Create > Workflow & Approvals > Workflow Rules
3. Click "New Rule"
4. Select the Custom Object and click Next
5. Put a Rule Name, i.e Naming Convention
6. select "created, and every time it’s edited"
7. on the Rule Criteria section, on the first drop down, look for the picklist field "number" then for the operator select "not equal to" then leave the value (empty) or blank then click on Save & Next.
8. on the next page, click on "Add Workflow Action" select "New Field Update" on the dropdown.
9. put a name for your field update, i.e name automation
10. on the "Field to Update dropdown", look for the custom object name field, "name" (then wait for second, option will show up)
11. select the radio button "Use a formula to set the new value"
12. then click on "Show Formula Editor"
13. click on Insert field button
14. on the second box, look for the custom object name field, "name"
15. then click "Insert" (shows up on the third box), 
16. then click on Insert Operator button, on the drop down look for Concatenate, this is the ampersand symbol "&"
17. then put this " " (quote space quote), then click on the insert operator button again and select concatenate
18. then type the word TEXT( 
19. yes, you need to include the open parenthesis, then click on Insert Field again, then look for the picklist field "number" in the second box then click insert
20. put a close parenthesis, once done, it should look like this

name__c & " " & TEXT(number__c)

21. click Save, then click "Done" on the upper right hand corner
22. then click "Activate"
23. You're done, you can test it out :)

hope this helps, I tried to be as detailed as possible, just let us know if you have questions. Thanks!
This was selected as the best answer
KULWANT SINGHKULWANT SINGH
Thanks Jayson........really good explanation
Mahesh Naidu 6Mahesh Naidu 6
what needs to be done if there is update in picklist value?
 
Mahesh Naidu 6Mahesh Naidu 6
This solution is not working