Joining two fields

siimsandsiimsand Member Posts: 28
Hello!

I have a pretty simple question. If I have 3 fields - First name, Last name and Full name. Then how do I join First name and Last name for Full name to appear?
I imagine it's something like:

First Name - OnValidate()
xRec."Full Name" := "First Name" + ' ' + "Last Name" ...

But I can't quite get the code right. Should I use a special function for this or am I missing something super easy?


Thanks in advance.

Best Answer

Answers

  • nick_robbonick_robbo Member Posts: 49
    Just create a function called something like GetFullName, which returns text....
    Call this in the OnValidate trigger of each Name field.

    So it would look something like this...
    "Full Name" := GetFullName;
    

    And the function would look like this...
    GetFullName() : Text[100]
    IF "Middle Name" = '' THEN
      EXIT("First Name" + ' ' + "Last Name");
    
    EXIT("First Name" + ' ' + "Middle Name" + ' ' + "Last Name");
    

Sign In or Register to comment.