catalog
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-02-2024 11:40 PM
Hi Team
Can any one please help me here ,
We have variable ' company code ' it is mutilple choice
And having 4 values in Company code .
Example :
00001
00002
00003
00004
And we have type of request variable
FGS - KingTone
FGS- mameber
If any user selected type of req is ' FGS - KingTone ' then in the company code '00001' and 00002 has to be populate .
If any user selected type of req is ' FGS- mameber ' then in the company code '00003' and 00004 has to be populate .
can any one please provide steps of Cilent script .
Please provide me script .
Thanks in advance
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-02-2024 11:54 PM
Hello @nameisnani
Could you please provide detailed explanations for the types of variables mentioned below
- FGS - KingTone
- FGS - membe
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-03-2024 12:23 AM
Don't use multiple choice type for company code, use select box type field. And write onchange client script on type of request variable, below is the code:
var typeOfRequest = g_form.getValue('type_of_request');
var companyCodeField = g_form.getControl('company_code');
// Hide all options
var options = companyCodeField.options;
for (var i = 0; i < options.length; i++) {
options[i].hidden = true;
}
// Show relevant options based on the type of request
if (typeOfRequest === 'FGS - KingTone') {
showOption('00001');
showOption('00002');
} else if (typeOfRequest === 'FGS- mameber') {
showOption('00003');
showOption('00004');
}
function showOption(value) {
var option = g_form.getOption('company_code', value);
if (option)
option.hidden = false;
}
Please Mark ✅Correct if this solves your query and also mark 👍Helpful if you find my response worthy based on the impact.
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-03-2024 12:26 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-03-2024 01:01 AM
With multiple choice field you will be able to select only one value out of four choices. So if client requirement is to select multiple choices you can create four checkbox type field(00001, 00002, 00003, 00004) and make company code field as Label type.(see screenshot)
If you can do that then below is the working code:
var typeOfRequest = g_form.getValue('type_of_request');
g_form.setDisplay('first', false); // first is the backend name of 00001
g_form.setDisplay('second', false); //second is the backend name of 00002
g_form.setDisplay('third', false); //third is the backend name of 00003
g_form.setDisplay('fourth', false); //fourth is the backend name of 00004
// Show relevant checkboxes based on the type of request
if (typeOfRequest === 'FGS - KingTone') {
g_form.setDisplay('first', true);
g_form.setDisplay('second', true);
} else if (typeOfRequest === 'FGS- mameber') {
g_form.setDisplay('third', true);
g_form.setDisplay('fourth', true);
}
Please Mark ✅Correct if this solves your query and also mark 👍Helpful if you find my response worthy based on the impact.
Thanks