I am using RetrieveRequest object to retrieve packaged and unpackaged components. Part of the code is:
String[] packageName = {"Salesforce for Google AdWords"};
RetrieveRequest retrieveRequest = new RetrieveRequest();
retrieveRequest.setApiVersion( API_VERSION );
String[] packageNames = retrieveRequest.getPackageNames();
System.out.println("Array length : " + packageNames.length );
retrieveRequest.setPackageNames( packageName );
setUnpackaged( retrieveRequest );
I am able to retrieve unpackaged components along with packaged components of "packageName" i.e "Salesforce for Google AdWords". But i am not able to retrieve "packageNames" via "getPackageNames()".
Is there any way i can retrieve names of all installed packages through API ? or if this is the way what wrong am i doing ? Is there is any other work around to get package names?
NamespaecPrefix
field onApexClass
to get namespace prefixes or use the method described here to get the full names.