Quantcast
Channel: CRM Development forum
Viewing all articles
Browse latest Browse all 8223

Javascript Issue

$
0
0

Hi

I have the following fields on my Contact form:
- new_firstname  (ex: Elaine)
- new_lastname   (ex: McKinnon)
- new_name (which is the new_firstname + new_lastname)

I have put the following code in
- OnLoad of Contact Form
- OnSave of Contact Form
- OnChange event of new_firstname
- OnChange event of new_lastname

So when I save the record or change the first name and last name
fields the new_name updated accordingly. In this case I changed
the last name to "Peace"

This works fine on the Contact Form, however when I go to view the
grid list of Active Contacts.. Elaine's Last Name is not displaying
"Peace" - it is displaying the old last name "McKinnon".

What do I need to do to resolve this issue?


function updateFullName(firstName, lastName, fullName)
{
 var fName = Xrm.Page.data.entity.attributes.get(firstName).getValue();
 var lName = Xrm.Page.data.entity.attributes.get(lastName).getValue();

 if (fName == null)
 {
  fName = "";
 }
        else
 {
  fName =  fName + " ";
 }
 if (lName == null)
 {
  lName = "";
 }
 Xrm.Page.data.entity.attributes.get(fullName).setValue(fName + lName);
}

 


Viewing all articles
Browse latest Browse all 8223

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>