16. Januar 2014 18:18
function Form_onload()
{
if((Xrm.Page.getAttribute("new_naip").getValue() == 1) || (Xrm.Page.getAttribute("new_naip").getValue() == 2))
{Xrm.Page.ui.tabs.get(3).setVisible(true);}
else
{Xrm.Page.ui.tabs.get(3).setVisible(false); }
}
function Form_onsave()
{
/* Obtain the required values. */
var sal = Xrm.Page.getAttribute("salutation").getValue();
var firstName = Xrm.Page.getAttribute("firstname").getValue();
var middleName = Xrm.Page.getAttribute("middlename").getValue();
var lastName = Xrm.Page.getAttribute("lastname").getValue();
var suf = ""; /* Xrm.Page.getAttribute("suffix").getValue(); */
/* Check to see whether the middleName variable is null before you add a comma. */
if(middleName != null)
{
middleName = middleName+",";
}
/* Check to see whether the lastName variable is null before you add a comma. */
if(lastName != null)
{
lastName = lastName+",";
}
if(suf == null)
{
middleName = Xrm.Page.getAttribute("middlename").getValue();
}
/* Create a variable to store the complete full name. */
var fullName = "";
/* Create an array to set the order of the full name. */
var fName = [lastName, sal, firstName, middleName, suf];
/* Create a second array to determine whether the associated name in the
fName array should be included in the complete full name. */
var includeFName = [true, true, true, true, true];
/* Create the value for the full name. */
for(var i = 0; i<fName.length; i++)
{
if((fName[i] == null) || (fName[i] == ","))
{
fName[i] = "";
includeFName[i] = false;
}
if(includeFName[i] == true)
{
fullName = fullName + fName[i] + " ";
}
}
/* Assign the value of the fullName variable to the custom Full Name field. */
Xrm.Page.getAttribute("new_completefname").setValue(fullName);
}
function new_naip_onchange()
{
if ((Xrm.Page.getAttribute("new_naip").getValue() == 1) || (Xrm.Page.getAttribute("new_naip").getValue() == 2))
{Xrm.Page.ui.tabs.get(3).setVisible(true);}
else
{Xrm.Page.ui.tabs.get(3).setVisible(false); }
}
function new_enteraleernaehrungs_onchange()
{
if (Xrm.Page.getAttribute("new_enteraleernaehrungs").getValue() == false) {
crmForm.all.new_enteraleernaehrungsd.disabled = true;
}
if (Xrm.Page.getAttribute("new_enteraleernaehrungs").getValue() == true) {
crmForm.all.new_enteraleernaehrungsd.disabled = false;
}
}
16. Januar 2014 19:09
var sal = "";
var salOgject = Xrm.Page.getAttribute("salutation"):
if (salObject != null) sal = salObject.getValue();