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

Community site session details

Session Id : nZ3bHSAN67Fo2tzMs3E1iA
Power Apps - Power Apps Pro Dev & ISV
Answered

Concat 2 fields with Javascript

Like (0) ShareShare
ReportReport
Posted on 22 Feb 2023 07:07:30 by 65

Hi

 

I need your support on the following topic, as I don't have any experience in JS

I'm implementing a JS to concat firstname and surname fields in name field, and it was working fine, but I've deleted it (just from the form properties not from web resources) to test something, but when I put it back it didn't work

this is the code 

function concatriskcompliancefields_onload()
{

var mohanade_firstname= Xrm.Page.getAttribute("mohanade_firstname").getValue();

var mohanade_surname = Xrm.Page.getAttribute("mohanade_surname").getValue();


Xrm.Page.getAttribute("mohanade_name").setValue(mohanade_firstname+ " "+mohanade_surname );

Xrm.Page.getAttribute("mohanade_name").setSubmitMode("always");

}

and this is how I implement it

 

mohanade_1-1677049617777.png

 

and this is the error I receive

 

mohanade_0-1677051815789.png

 

 

 

  • Verified answer
    a33ik Profile Picture
    3,304 Most Valuable Professional on 22 Feb 2023 at 13:25:46
    Re: Concat 2 fields with Javascript

    Hello,

    In your second screen where you register event handler replace concat by concatriskcompliancefields_onload.

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

Announcing our 2025 Season 2 Super Users!

A new season of Super Users has arrived, and we are so grateful for…

Paul Stork – Community Spotlight

We are honored to recognize Paul Stork as our July 2025 Community…

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 791 Most Valuable Professional

#2
MS.Ragavendar Profile Picture

MS.Ragavendar 410 Super User 2025 Season 2

#3
mmbr1606 Profile Picture

mmbr1606 275 Super User 2025 Season 2

Loading complete