Auto populate field with business rule

asd22
Tera Contributor

Hello

I have 3 fields "user" wich has the full name of the user and "case number", i want the info from these two fields to be auto populated into my third field "short description" So it will look like this

(short description field): username - case number

 

I need to do this with a business rule, any tips?

1 ACCEPTED SOLUTION

Hi @asd22 
Use this to get the correct information


current.short_description = current.user.name +' - '+current.case_number;

Mark helpful if this resolves your query.
Thanks!

View solution in original post

9 REPLIES 9

Aman Kumar S
Kilo Patron

You can have a before insert/update business rule

current.short_description = current.user_field + "-" + current.case_number;//just validate the field names

Best Regards
Aman Kumar

Hey this works really well, i only got 1 problem now it seems.

The user field seems to display the first and last name on the form, but when i use it in the script i only get the userID (long line of numbers) Any clue how to fix this?

Hi @asd22 ,

 

Yep, that is because you get the SysID and not the username. Please use getDisplayValue() and also please check what field is set for display value.

 

If my answer has helped with your question, please mark my answer as accepted solution and give a thumb up.

 

best regards

Anders

If my answer has helped with your question, please mark my answer as the accepted solution and give a thumbs up.

Best regards
Anders

Rising star 2024
MVP 2025
linkedIn: https://www.linkedin.com/in/andersskovbjerg/

_Gaurav
Kilo Sage

Hi @asd22 
You can write a before BR 

 

current.short_description = current.user +' - '+current.case_number;

 

Please mark this as helpful if this resolves your query

Thanks!