Names Field

I’ve created a Names field on a form that uses “Address dialog for choices”. For input translation, I’ve used the following @Formula:

@Sort(@Name([CN]; EmployeeName); [Ascending]) where EmployeeName is the name of the field in question.

This successfully converts Firstname Lastname/Company to simple Firstname Lastname.

What I really want to accomplish is Lastname, Firstname.

I’ve monkied around with @Subset, @Explode, @Text and text concatenation in various combinations to no avail. How to I accomplish this when the “Allow multiple values” option is selected.

Subject: Names Field

Try:

names := @Name([CN]; EmployeeName);

lastFirst := @Rightback(names; " ") + ", " + @LeftBack(names; " ");

@Sort(lastFirst; [Ascending])

But this should NOT be the translation formula for the EmployeeName field. It would break the second time the translation formula is run.

Instead, create a computed EmployeeNameSorted field that has this formula. You may choose to hide the EmployeeName field when the document is bein read (just showing the sorted list).

There could be a way to sort by lastname in the translation formula, but you should avoid reformatting to Lastname, Firstname.

Try something like:

names := @Name([CN]; EmployeeName);

lastFirst := @Rightback(names; " ") + " " + @LeftBack(names; " ");

sorted := @Sort(lastFirst; [Ascending])

@Right(sorted; " ") + " " + @Left(sorted; " ")

… which may possibly work in a Translation formula.

Subject: Names Field

You cannot do it by trying to manipulating the data obtained from your default View, particularly if you have many names selected.

There are just too many steps required to do within a single Translate formula.

You could use a similar formula that the NAB uses for the Names column i.e.

Name in Address Book


@Trim(@Subset(LastName;1))+@If(Firstname !=“”;" , “+@Trim(@Subset(FirstName;1));”")

Or you could do some back-end processing which takes the entries out of the field, translates them the way you want and puts them back. This should be done when the document is being Saved, by LotusScript.

Regards

Rolf Pfotenhauer