Set value of a condition field

Kostya
Tera Guru

Hi,

i need help with setting a condition field (you know: the filter condition field that depends on a collection field).
I am implementing new application where I have a new ticket type and have a kind of template with a condition field (name: u_condition; type: condition: depends on: u_collection).

I am able to read the value of that filed by default g_form.getValue('u_condition').
But it is not possible to set the value of the other condition field by g_form.setValue('u_condition', '=', condition)

My script is:

function setConditionFromConditionTample() {
   var template = g_form.getReference('u_filter_template');

   if(template !== null) {
       if(g_form.getValue('u_table') == template.u_collection) {
           alert(template.u_condition);                                                                                                     // alert: active=true^EQ
           g_form.setValue('u_condition_string', template.u_condition); // nothing happen here
           return true;
       } else {
           alert('Selected template has to match with filter table. Select another template or contact your administrator, please.');
       }
   } else {
       alert('Filter template could not be loaded. Please contact your administrator.');
   }

   return false;
}


***********

the variable
template.u_condition
does have the value like
active=true^EQ
. But the condition field doest updated.

Any expirience with that?

Kind regards
Konstantin
Hit the Thumb Icon and/or mark as Correct, if my answer was correct. So you help others to see correct responses and I get fame 🙂

Cheers,
Kostya
5 REPLIES 5

Hi, condition field consists of two fields actually. Condition and the related table field. Please, try also setting the value in the related field for the "table" or verify if the value is already set. Like in the example from Anubhav.

 

Kostya_0-1693864449851.png

 

Hit the Thumb Icon and/or mark as Correct, if my answer was correct. So you help others to see correct responses and I get fame 🙂

Cheers,
Kostya