Record producer assignment logic

Diogo Luz
Tera Expert

Hello,

I have a record producer that allows users to submit a new Demand via portal. I'm trying to apply the following logic:

 

If variable 1 (type checkbox) is true, then demand manager should be Person A.

but

If either variable 2, 3, 4 or 5 are selected (true), then demand manager should be Person B.

 

I've tried both with Catalog Client Script and UI Policy, but i'm getting some errors. In the record producer itself, the script field has already some logic so I'm trying to avoid writing there.

This is the base script I'm trying to use:

 

 

if (current.variable_2 || current.variable_3 || current.variable_4 || current.variable_5) { 
    current.demand_manager = 'Person B'; 
  } else if (current.variable_1) { 
    current.demand_manager = 'Person A'; 
  } 
  current.update();

 

 

Any feedback on what am I doing wrong, or where should I go?

Thanks in advance

 

1 ACCEPTED SOLUTION

Diogo Luz
Tera Expert

I was overthinking in this case. I've found an easier way to do it through a Catalog UI Policy. I applied the relevant conditions and then added a small script:

 

g_form.setValue('demand_manager', 'user sys id', 'User Name');

 

If condition=false it will assign the other demand manager.

 

Easier way 🙂

View solution in original post

3 REPLIES 3

Meloper
Kilo Sage

In Serverside try this

if (current.variables.variable_2 || current.variables.variable_3 || current.variables.variable_4 || current.variables.variable_5) { 
    current.demand_manager = 'Person B'; 
  } else if (current.variable_1) { 
    current.demand_manager = 'Person A'; 
  } 
  current.update();

In a Client Side try this

g_form.getValue("variablename")
g_form.getBooleanValue ("variablename")

to build you script.


TO set the Assignment Group you can also try to use a Assignment Rule.

Which will use the ServerSite Script

Thank you for your quick help Meloper. I have two questions, when you say server side do you mean a business rule? And regarding client side can it be a catalog client script?

Diogo Luz
Tera Expert

I was overthinking in this case. I've found an easier way to do it through a Catalog UI Policy. I applied the relevant conditions and then added a small script:

 

g_form.setValue('demand_manager', 'user sys id', 'User Name');

 

If condition=false it will assign the other demand manager.

 

Easier way 🙂