Hi @aishwarya,
Can you post a screenshot of the global code you are searching?
Because generally the ‘sequence’ field in the global_code_table is numeric and it will yield no results if searched by a string value.
Hi @IniNimesK
thank you for your response.
please find the attachment for your reference
Hi @aishwarya,
Can you post a screenshot of the global code you are searching?
Because generally the ‘sequence’ field in the global_code_table is numeric and it will yield no results if searched by a string value.
@aishwarya as mentioned here it seems like you need to build a proper mapping to search instead of using the sequence field. Either using a user_def or using the parent code values in the global code table.
Hi @IniNimesK,
Thank you for your response. Request if you can elaborate on this or help me with an example.
Hi Team,
Now the requirement has been changed
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