How to split the Variable Value in Client Script

Anil Kumar Sha1
Giga Contributor

Hi Team,

Customer is created the property (choice_value) and define the value like 2014,2015,2016,2017 and want the same value in field as drop down on cost form under PPM module.

I created the Business rule and store the Value  in  scratch pad like scratchpad. Choice=gs.getProperty (choie_value) and  use the scratch pad value on load client script but I need know that how I can split the value of scratchpad.choice  in client script. Plz. Suggest.

 

1 ACCEPTED SOLUTION

Hi Anil,

The first business rule for scratchpad should also be added in Incident table. Can you please change the table to incident and then test it once?

 

View solution in original post

5 REPLIES 5

Alikutty A
Tera Sage

Hello,

You can use the split function to split values. Try the following script and let me know

var choices = g_scratchpad.choices.split(",");

for(var i =0; i< choices.length; i++){

 g_form.addOption("field_name", choices[i], choices[i]);

}

 

Abhinay Erra
Giga Sage

Make sure you cleanup all the choices by using clearOptions() and build the list. I would also index to the function

 

var choices = g_scratchpad.choices.split(",");
g_form.clearOptions('field_name');

for(var i =0; i< choices.length; i++){

 g_form.addOption("field_name", choices[i], choices[i], i);

}

Hello Team

 

i have created the business rule which is runing  on system property table

 

find_real_file.png

find_real_file.png

 

 

and created the client script on onload  but value is not coming in u_Year field.  Plz. help

 

find_real_file.png

Hi Anil,

The first business rule for scratchpad should also be added in Incident table. Can you please change the table to incident and then test it once?