Hello All ,
Referring to the below ARIS Code , i trying to find the specific models from database and moving to another folder on the same database . When iam executing this script on particular group to get these models, this code its providing me the models from all groups . Example : A, B, C and D are groups in my database and trying to execute this code on group A to get specific models . But its taking all these specific models from all these four groups . Actually its should have taken from A group only . Pleaseverify the attached code and do the needful if any changes required to get desired output .
*************************************
Code updated below
***************************************
var g_nLoc = 1033;
var g_oOutfile = null;
function main(){
var oCurrentDatabase=ArisData.getActiveDatabase().ActiveFilter();
var oAllICDsOfTheDatabase=new Array();
var searchItem2 = oCurrentDatabase.createSearchItem(Constants.AT_NAME,g_nLoc,"*NGU",Constants.SEARCH_CMP_EQUAL, true, true);
var oAllICDsOfTheDatabase=oCurrentDatabase.Find(Constants.SEARCH_MODEL,null,searchItem2);
Regards,
Rams.
Alberto Martins on
In You code You are executing the find in the Context of the Selected DataBase and not in the Context of the Selected Group .
to be able to find in the Selected Group you must do the find in the speciofic Group, You can catch it by executing "ArisData.getSelectedGroups()"
dont't forget that the Report execution must be started from the Group where are located the Models You want to move.