Extended Information
- Last UpdatedJun 25, 2024
- 2 minute read
Use scripts for the Extended Information property to allow or deny a user to access the extended information (that is columns other than the display and value columns of the result set) based on the selection for a Data Grid, Data Lookup, Pop-Up, or User Lookup control.
When a Data Lookup, Data Grid, or Hierarchical Grid is mapped to a Web API Lookup, the JSON object is returned as a JSON string.
To allow or deny a user to access the extended information based on the selection for the control
-
Code the script as follows for the Extended Information property of a Data Grid or Data Lookup control:
|
Task |
Script |
|---|---|
|
return true; |
|
return false; |
To get extended information based on the selection on data change event
Example
Data Lookup
// Get extended information based on the selection on data change event.
var extendedInformation = control.extendedInformation;
if(extendedInformation !== null && extendedInformation !== undefined)
{
// Here Property Name is replaced with EmployeeName, which is the column name for the database lookup.
control.findById("T1").value = extendedInformation["Title"];
//Alternatively use extendedInformation.EmployeeName;
}
Data Grid
// Get extended information based on the selection on data change event.
var rowData = control.findById("G1").extendedInformation; // Array
if(rowData.length > 0)
{
control.findById("T1").value = rowData[0].ID;
}
else
{
control.findById("T1").value = ""; // Undefined
}
Note: The DateTime column types would contain DateTime values (not String values), when the Use Culture Specific Values property is set to No.
Hierarchical Grid
var ex = control.extendedInformation;
var jobs = ex[0].WorkOrder.Job;// if multiple jobs is selected then Job will be array
if ($.isArray(jobs))
{
control.findById("T1").value ="";
for (var i = 0; i < jobs.length; i++)
{
control.findById("T1").value = control.findById("T1").value + " " + jobs[i].oper_id;
}
}
else
{
control.findById("T1").value = jobs.oper_id;
}
Note: The lookup names used in the hierarchical grid are WorkOrder and Job.
User Lookup
// Get extended information based on the selection on data change event.
// Property Names for Active Directory Provider.
var extendedInformation = control.extendedInformation;
if(extendedInformation !== null || extendedInformation !== undefined)
{
control.findById("T1").value = extendedInformation["UserDepartment"];
control.findById("T2").value = extendedInformation["UserDesignation"];
control.findById("T3").value = extendedInformation["UserDisplayName"];
control.findById("T4").value = extendedInformation["UserDistinguishedName"];
control.findById("T5").value = extendedInformation["UserEmail"];
control.findById("T6").value = extendedInformation["UserId"];
control.findById("T7").value = extendedInformation["UserManager"];
control.findById("T8").value = extendedInformation["UserName"];
control.findById("T9").value = extendedInformation["UserRole"];
}
// Using User Lookup extended information in scripts of other controls.
var userLookupControl = control.findById("U1");
if(userLookupControl.value !== "")
{
var userLookupExtendedInfo = userLookupControl.extendedInformation;
if(!SFU.isUndefined(userLookupExtendedInfo))
{
return userLookupExtendedInfo.UserEmail;
}
}