Hi there,
I've some trouble with the return value of the Aris method BrowseArisItems.
It is supposed to return
"selected items as a string containing the IDs (GUID, OID or string) of the selected items, separated by ";". |
So I expect a String containing a GUID by choosing one VAC from the dialog created by this method. But the return value is not the GUID, it is not even a String.
I can handle the String conversion, but I'd like to know which value is returned by the method.
Has anyone experienced similar behaviour? Could it be a problem regarding the encoding?
Regards,
Maik
Hi Maik,
It looks like that method returns a string containing Object IDs seperated by ";"
Have a look at the following code:
var nLanguage = Context.getSelectedLanguage(); var aDatabase = ArisData.getActiveDatabase(); var sServerName = aDatabase.ServerName(); var sStr = Dialogs.BrowseArisItems("Select Model","Select one or more Models",sServerName,aDatabase.Name(nLanguage),Constants.CID_MODEL); Dialogs.MsgBox(sStr); if (sStr == ""){ Dialogs.MsgBox("Please select one or more Models"); }else{ var arr = sStr.split(";"); Dialogs.MsgBox(arr.length + " Models selected"); for(var i=0; i<arr.length; i++) { var oModel = aDatabase.FindOID(arr[i]); if (oModel.KindNum()==Constants.CID_MODEL) Dialogs.MsgBox(oModel.Name(nLanguage) + "(" + oModel.Type() + ")"); } }
Hope this helps.
Hi Guys,
The command works for models, but not for filters, I just get a blank selection screen...
This happens even if I use the command without the DB specified. Please test it and let me know:
CID_METHODFILTER
var nLanguage = Context.getSelectedLanguage(); var aDatabase = ArisData.getActiveDatabase(); var sServerName = aDatabase.ServerName(); var sStr = Dialogs.BrowseArisItems("Select Model","Select one or more Models",sServerName,aDatabase.Name(nLanguage),Constants.CID_METHODFILTER); Dialogs.MsgBox(sStr); if (sStr == ""){ Dialogs.MsgBox("Please select one or more Models"); }else{ var arr = sStr.split(";"); Dialogs.MsgBox(arr.length + " Models selected"); for(var i=0; i<arr.length; i++) { var oModel = aDatabase.FindOID(arr[i]); if (oModel.KindNum()==Constants.CID_MODEL) Dialogs.MsgBox(oModel.Name(nLanguage) + "(" + oModel.Type() + ")"); } }
Please advise, thx.
Francois