Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Apps - Power Apps Pro Dev & ISV
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

 

 

 

  • Verified answer
    a33ik Profile Picture
    3,304 Most Valuable Professional on at
    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 the Engage with the Community forum!

This forum is your space to connect, share, and grow!

🌸 Community Spring Festival 2025 Challenge Winners! 🌸

Congratulations to all our community participants!

Warren Belz – Community Spotlight

We are honored to recognize Warren Belz as our May 2025 Community…

Leaderboard > Power Apps - Power Apps Pro Dev & ISV

#1
WarrenBelz Profile Picture

WarrenBelz 109 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 82 Super User 2025 Season 1

#3
mmbr1606 Profile Picture

mmbr1606 71 Super User 2025 Season 1

Overall leaderboard