Highlighted
Acclaimed Contributor.. Acclaimed Contributor..
Acclaimed Contributor..
335 views

rad application call from JS

Experts,

I am trying to do the rad app call us.rebuild.groups from the JS. 

Tested the rad app by merely passing the group name , but didnt return anything,  How do I test the return code of the rad app call.

please guide.

 // Mass rebuild of the all the cmgroups.

var cmProf = new SCFile('cm3profile')
if (cmProf.doSelect(query) == RC_SUCCESS)	{	

	print(cmProf.name)
	print(cmProf.approval_groups)
	var aArray = []
	aArray = cmProf.approval_groups.toArray()
	
	for (var i = 0; i < aArray.length; i++)	{	
		
		print(aArray[i])
		var cmGrp = new SCFile('cm3groups');
		var q1 = "name=\""+cmProf.name+"\"";

		
		
		if (cmGrp.doSelect(q1) == RC_SUCCESS)	{	
			
		
			
			var rc = 		new SCDatum()
			var rteNames  = new SCDatum()
			var rteValues = new SCDatum()
			
			
			rteNames.push("group")						
			rteValues.push(cmGrp.name);
						
			print(rteNames+"---------------"+rteValues);

												  
			var z = system.functions.callrad("us.rebuild.group",
											   rc,
											   ["name"],
											   [cmGrp.name],
											   true)
			
			 print(RCtoString(rc));
			
			
		}
	
	}
	
}
I am Listening..
0 Likes
2 Replies
Highlighted
Acclaimed Contributor.. Acclaimed Contributor..
Acclaimed Contributor..

Re: rad application call from JS

Hello,

I don't hav "hands on" the system for a long time already but should not you pass anything or assign some value to the first "if query" in the top of the script ?

if (cmProf.doSelect(query) == RC_SUCCESS)

 

0 Likes
Highlighted
Acclaimed Contributor.. Acclaimed Contributor..
Acclaimed Contributor..

Re: rad application call from JS

The us.rebuild.group RAD application takes one parameter - string1 - and the value of that should be the group record (not the group name) that you want to rebuild.  Take a look at the cm3groups formatctrl record in the Addl Options panel for an example.

So, I _think_ your issue is that your call _should_ look like the following:

			var z = system.functions.callrad("us.rebuild.group",
											   rc,
											   ["string1"],
											   [cmGrp],
											   true)

Try that and see if that gets the results you're looking for.

0 Likes
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.