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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Concat 2 fields with J...
Power Apps
Answered

Concat 2 fields with Javascript

(0) ShareShare
ReportReport
Posted on 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

 

 

 

I have the same question (0)
  • Verified answer
    a33ik Profile Picture
    3,306 Most Valuable Professional on at

    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

Season of Sharing Community Challenge Launch!

Jump in, show your community spirit, and win prizes!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
Valantis Profile Picture

Valantis 494

#2
WarrenBelz Profile Picture

WarrenBelz 352 Most Valuable Professional

#3
11manish Profile Picture

11manish 323

Last 30 days Overall leaderboard