How to create multiple selection checkbox in Record producer?

alvatindra
Giga Contributor

I have a requirement to create a multiple selection checkbox field, where I can select multiple options.

I have to store the values of the options in the corresponding table when record producer is submitted.

Ex:

find_real_file.png

I want to store the checkbox values in the corresponding field of the table(incident) when record producer is submitted.

There is no option to create the checkbox in the table, I have created the list field   and tried to map the options from the record producer but its not working.

How this functionality can be achieved.

Please Share your knowledge regarding this.

--Tindra

8 REPLIES 8

mamann
Mega Guru

Hi Tindra,



If I'm reading your requirement correctly, you need to be able to map checkbox values from a Record Producer to corresponding checkboxes on the target form?


If so, you can create True/False fields on the form which are the same as checkboxes.


Hi Mark,



It is working fine, I am able to achieve the functionality.


I have created the fields with type true/false in the table and   I have created the checkboxes in the record producer.



There is a variable with xyz and it has options as a, b, c.


I have created the fields for a,b,c in the table and in record producer.


To keep this options a,b,c under the xyz field, i have created a label with display name as xyz and kept a,b,c options under xyz.


The problem here is, the field is mandatory one which can't be given to label.



You can find the image below (I have created Equipment needed as a label). I have to make this field mandatory .How this can be done?



find_real_file.png


Hi Tindra,



create a UI policy and make the label mandatory. Use the options for the condition.



If users doesn't select any option, the system will show a pop up that "Additional Info" is mandatory.



---Abhimanyu


Hi Tindra,



To acheive this functionlity, you need to write 2 Client Scripts:



1. OnLoad Script to make the label as "Red":



Below is the Script:



function onLoad(){


    var mandatoryLabel = 'Equipment Needed';


    //Get all of the LABEL tag elements and check for a matching label


    $$('label').each(function(labels) {


          if(labels.innerHTML == 'Equipment Needed'){


                //Set the 'mandatory' class name for the label element


                labels.previousSibling.className = 'mandatory';


          }


    });


}


2.OnSubmit Script to check the value of checkboxes.


If all the checkboxes are False   then write "return false" statement. This will force the user to select atleast 1 checkbox.