Cadet 2nd Class Cadet 2nd Class
Cadet 2nd Class

SMS assignment group using JScript

Hi all,


I have a JavaScript which works to send out SMS to contacts. Attached is the setup on system.


However, I'm trying to send SMS notification to an assignment group (multiple operators in a group).


Appreciate if someone can guide me URGENTLY how this can be achieved. 


Below is the JScript:


* Find a persons or email address for notifications from any file
* Parameters:
* file: dbdict file name to search
* uniqueid: unique field of the dbdict used to locate the desired record within "file"
* trigger: control field that will be evaluated within the target record to determine if recipients should be retrieved.
* if trigger is not supplied then recipients WILL be retrieved
* fields: field(s) within the record as determined by field & uniqueid that contain the desired recipients
* The fields parameter must be an array of text!! {"field1","field2"}
*function getRecipientFromRecord(file, uniqueid, trigger, fields)


function getRecipientFromRecord(file, uniqueid, trigger, fields)
var ftable = new SCFile(file);
var uField;
var control = true;

// Here we grab the unique id field for common tables, we were passed the needed table in the function call
case "company": {uField = "imsitenumber";break;}
case "contacts": {uField = ""; break;}
case "assignment": {uField = "name";break;}
case "incidents": {uField = "";break;}
case "ocmq": {uField = "number";break;}
case "probsummary": {uField = "number";break;}
case "device": {uField = "";break;}
case "location": {uField = "location.code";break;}
default: {uField = "name";break;}

// Query the record of the table provided in the function call
ftable.doSelect(uField + " = \"" + uniqueid + "\"");

// Here we need to convert the SC array to a Javascript array and
// change the field name from SC convention to Javascript convention by replacing periods with underscores

fields = fields.toArray(); // change the fields array from SCDatum to Javascript
var index = fields.length; // determine the number of elements
var recipients = new SCDatum(8);

if (trigger != null || trigger != "")
//control = functions.evaluate(functions.parse(ftable.trigger));

for(index in fields)
fields[index] = fields[index].replace(".", "_");

// If any of the supplied fields are arrays we must test for this and loop through adding elements to recipients 1 at a time
// otherwise just add the text field

if(system.functions.type(ftable[fields[index]]) == 😎
var x = 0;
//print("The array is this long: " + ftable[fields[index]].getSize());

var arr = new SCDatum(8);
arr = ftable[fields[index]].toArray();

x = x + 1;
}while(x < ftable[fields[index]].getSize())



if(control == true)

return recipients;




2 Replies
Fleet Admiral
Fleet Admiral

Why cannot use simple notification of type "page" to fire page events for operators belonging to that particular assignment group...


Msg Class          :          pm

Msg No              :          501

Arguments          :          Your own arguments which you can pass to eventout record

Condition            :          true

Notify method      :         page

Recepients         :          assignment in $L.file

Group file           :          assignment


Absent Member.. Absent Member..
Absent Member..

Hello Ramesh

Can you elaborate more on the above post ?

Kindly assign kudos if the post is helpful!
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.