I need to return multiple values from a script in business rules

Jerome MAISETTI
Mega Guru

Hello
I have a business rule to filter the possible contacts to add in the manual external comment lists.
I have the following script that currently returns only the users from the case's company

 

function getFilterExternalComment(){

var companysysid = current.company;
var parentcompanysysid = current.company.parent;
if (getugroupuser()=="OCD-EU" || getugroupuser()=="OCD-UK" || getugroupuser()=="OCD-INTL")

return "company=" + companysysid;
//+ "^ORcompany=5c9bdd3101f3b800fa5ff1cd4a39695f" + "^ORcompany=fc0557905ca4d1008250bb9066814b6f" + "^ORcompany=" + parentcompanysysid;
// éventuellement on peut rajouter la company AIS => "^ORcompany=5c9bdd3101f3b800fa5ff1cd4a39695f";
else
return "";
}

 

I would like to also return two specific companies with their sys ids and the parent company of the ticket company.
However , the OR condition seems not working. I tried as you can see in my lines commented.

Can someone give me a hand to find my way out ?

Thanks
Jérôme

1 ACCEPTED SOLUTION

Muhammad Khan
Mega Sage
Mega Sage

Try once with below statements.

 

return "companyIN" + companysysid + "," + "5c9bdd3101f3b800fa5ff1cd4a39695f" + "," + "fc0557905ca4d1008250bb9066814b6f" + "," + parentcompanysysid;

 

or 

 

return "company.sys_idIN" + companysysid + "," + "5c9bdd3101f3b800fa5ff1cd4a39695f" + "," + "fc0557905ca4d1008250bb9066814b6f" + "," + parentcompanysysid;

View solution in original post

2 REPLIES 2

GodOfWar
Mega Guru

I suggest to use an array for multiple values. Try the link below:

 

https://snprotips.com/blog/2016/2/6/gliderecord-client-side-vs-server-side

 

Mark Helpful if it helps.

Muhammad Khan
Mega Sage
Mega Sage

Try once with below statements.

 

return "companyIN" + companysysid + "," + "5c9bdd3101f3b800fa5ff1cd4a39695f" + "," + "fc0557905ca4d1008250bb9066814b6f" + "," + parentcompanysysid;

 

or 

 

return "company.sys_idIN" + companysysid + "," + "5c9bdd3101f3b800fa5ff1cd4a39695f" + "," + "fc0557905ca4d1008250bb9066814b6f" + "," + parentcompanysysid;