Text Concatenation Microflow in Mendix Studio

0
I am fairly new to this tool – so please excuse what might be a novice question I have a “Person” entity defined with “FirstName” and “LastName” string attributes. I want to automatically concatenate these two attributes into another attribute called “FullName” (also string) when either the FirstName or LastName attributes are changed.  I can see examples where something similar is defined – but I have no idea how to implement these examples using Mendix Studio.  Please can someone give me the step-by-step process? In the example i can see the expression but  where do i put this and how do i trigger it when FirstName or LastName changes?  trim( $ContactPerson/Fullname + ' ' + trim( $ContactPerson/Firstname ) )  
asked
1 answers
2

Hi Gary,

The easiest way to do this would be on the Entity “Person” you can create a Before Commit event microflow which will run before any commit actions on that Entity are performed. E.g. on your New/Edit page when you save.

To do this:

  • Open Person in Domain Mode
  • Click Event Handlers
  • Create a new Before Commit event handler
  • Click Select Microflow and create a new microflow somewhere called “BCo_Person_ConcatName”
  • Open the microflow and add a Change Object action
  • Select the Person object and add the FullName attribute to be changed.
  • Enter “trim($Person/FirstName) + ' ' + trim($Person/LastName)”

 

Here is what this should look like: 

answered