web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Suggested Answer

Want to first and last string in ax 2012

(0) ShareShare
ReportReport
Posted on by 145

Hello Everyone,

Kindly help me I want below result in name field , How would I get.

I want first and last string compulsary and then first letter from second string, Some Example I have given as show below.

Name in the system

Result

Andrew CUSHION

Andrew CUSHION

Andrew Dean CUSHION

Andrew D CUSHION

Andrew Dean Gerald CUSHION

Andrew D CUSHION

Andrew Dean Gerald Arnold CUSHION

Andrew D CUSHION

I have the same question (0)
  • Martin Dráb Profile Picture
    237,965 Most Valuable Professional on at

    Your problem is caused by a wrong data model. You're violating the first normal form by not having atomic values in the name. Consider fixing the model, rather than building workarounds in code.

    If you can't fix the model, take the string and split it to words, e.g. by strSplit(name, ' '). Then take the first and last ones and if the number of words is higher than 2, take the second word and extract the first character by subStr().

  • Suggested answer
    nmaenpaa Profile Picture
    101,162 Moderator on at

    If you look at the standard system and how names are handled, there are separate fields for first, middle and last names. Please follow this same approach in your functionality.

    Then it's also very easy to achieve the result that you need:

    1) Take the value from FirstName field

    2) Take first character from MiddleName field

    3) Take the value from LastName field.

  • Suggested answer
    Microsoft Profile Picture
    on at

    you can try to use the SQL keyword: split .

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > Finance | Project Operations, Human Resources, AX, GP, SL

#1
Martin Dráb Profile Picture

Martin Dráb 451 Most Valuable Professional

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 428 Super User 2025 Season 2

#3
BillurSamdancioglu Profile Picture

BillurSamdancioglu 239 Most Valuable Professional

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans