How to write a function definition with reference fields

Carter1
Giga Guru

Hi all,

I have a function field that I am trying to concat three separate fields together with "-" in between each. All of these fields are reference fields. I have done it in the past but I can not remember how to write the function so the concat is the display value instead of the sys_id's concat.

Here is my function:

find_real_file.png

 

find_real_file.png

 

1 ACCEPTED SOLUTION

FYI for anyone with the same question:

I figured it out, I was referencing the column names incorrectly when dot-walking..

Ended up being glidefunction:concat(u_cost_center.u_cost_center,"-",u_gl_account.account_name,"-", u_vendor.u_name)

Just make sure you validate the dictionary names, I assumed I had it correct and you know what they say when you assume..

View solution in original post

5 REPLIES 5

Chuck Tomasi
Tera Patron

Have you tried using getDisplayValue()?

Ex: u_cost_center.getDisplayValue(), ' - ', ...

Hi Chuck,

I did try using getDisplayValue(), when I did it returned "invalid function" to the function field.

find_real_file.png

 

Maybe my syntax is wrong? I thought I dot-walked the last time I did this but I tried that to and nothing.

Chuck Tomasi
Tera Patron

Is the point to simply have one field that concatenates the values of others? It might be more optimal to just write a BR that checks if any of other other fields changed and then update this one with the appropriate display values as needed. That way it only runs when necessary and not all the time.

Yes, that's what I'm trying to do. Maybe I will do that instead. It's just baffling because I know I've done it in the past with reference fields and now I can't remember how I did it.