DevOps Cloud (ADM)
Cybersecurity
IT Operations Cloud
onChange event in “CN” field:
{
var v = IDVault.globalQuery(null, "phone", {"cN":z});
if (v[0]!="") { //If a DN is returned, process these actions
form.showMsg("You are Modifying an existing Extension.");
var own = IDVault.get(null, String(v[0]), 'ClientPhone', 'Owner');
if (!undef(own[0])) { //custom inline script assesses if the “Owner” Attribute null.
form.setValues("Owner",own);
}
else {
form.setValues("Owner", '');
//The following lines retrieve and set current values found on the existing object.
form.setValues("Surname", (IDVault.get(null, String(v[0]), 'ClientPhone', 'Surname')));
form.setValues("Given_Name", (IDVault.get(null, String(v[0]), 'ClientPhone', 'GivenName')));
form.setValues("Description", (IDVault.get(null, String(v[0]), 'ClientPhone', 'Description')));
//Next is moot to the discussion…Custom code generates an event based on the field name and the event
//from which it originates. In this case, “onChange-CN” is fired.
publishEvent(field,event);
//Retrieving the “protected” phone attributes, if they exist.
var j = (IDVault.get(null, String(v[0]), 'ClientPhone', 'jobCode'));
if (!undef(j[0])) {
field.fireEvent("jobexists");//causes code on the jobCode Field to select the current
//value from the pick list.
} else {
field.fireEvent("jobnix"); //Critical reset function, in support of item D in the summary
}
var loc = (IDVault.get(null, String(v[0]), 'ClientPhone', 'ClientLocationCode'));
if (!undef(loc[0])) {
field.fireEvent("locexists");//causes code on the Locations Field to select the current
//value from the pick list.
} else {
field.fireEvent("locnix");//Critical reset function, in support of item D in the summary
}
}
else
{ //BLANK All of the fields, since this is a NEW phone.
var dnval = "cn=" z ",ou=pho,ou=res,o=data";
// form.showMsg("DN value is: " dnval);
form.setValues("dn", dnval);
form.setValues("Owner", '');
form.setValues("Surname", '');
form.setValues("Given_Name", '');
form.setValues("Description", '');
form.setValues("ClientPhoneAvailable", '');
form.showMsg("You are creating a NEW Extension");
}
}
Phone Available Field: onChange-CN event:
{
var v = IDVault.globalQuery(null, "phone", {"cN":z});//DN of the phone object is retrieved
var x = IDVault.get(null, String(v[0]), 'ClientPhone', 'ClientPhoneAvailable');//value of available is retrieved
var value = (x.toString().toLowerCase() == "true");
check(field,value);//custom code converts this to a Boolean result
}
{
try
{
if ( value )
{
field.setValues(["true"]);
}
else
{
field.setValues([""]);
}
}
catch (e) {}
}
JobExists Event on JobCode Field:
onLoad Events:
jobCode Field: jobnix event