Hi Team,
I am getting error in my client script.
Below find the detail requirement
Table - ESCALATION
COLUMN - USER_DEF12 , USER_DEF5
User_def12 (dropdown) contains - BRT_BUS,AMT_BUS
user_def5 (text box)- bus_no
The user wants that if user_def12 is AMT_BUS , then the bus number should belong to AMT. Otherwise, it should throw an error saying "Bus number is not valid." They have provided all the bus no . so I have added those bus no in the global_code_table.
So for this i have created a client script
Below find my script
var transittype = getControlValue("escalation", "user_def12");
if (transittype == "AMT_BUS") {
var busNumber = getControlValue("escalation", "user_def5");
var query = stringFormat("SELECT code_value FROM global_code_table WHERE code_name = 'IN_AHM_AMT_BUS_NO' AND Description = '{0}' AND code_value = '{1}'", transittype, busNumber);
var regno = getDBValue(query);
if (regno) {
// If regno is not null or empty, it means the bus number is correct
alert("Bus number is correct.");
} else {
// If regno is null or empty, it means the bus number is wrong
alert("Bus number is incorrect.");
}
} else {
alert("Transit type is not AMT_BUS, validation skipped.");
Here in the variable “reg_no” ,getting value undefined.
Please help me out on this
Thanks In advance