function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Lightning UserLightning User 

Metadata checkstatus

    Ok so I made this checkStatus function:

Code:
private static void checkStatus(MetadataBindingStub metaBinding,
   AsyncResult[] ars) throws RemoteException {
  ArrayList<String> idList = new ArrayList<String>();
  for (int i = 0; i < ars.length; i++) {
   idList.add(ars[i].getId());
  }
  String [] Ids = (String[])idList.toArray(new String[idList.size()]);
  for (int i = 0; i < ars.length; i++) {
   while (!ars[i].isDone()) {
        ars = metaBinding.checkStatus(Ids);
        System.out.println("Status: " + ars[i].getId() + ": "+ ars[i].getState().toString());
        if (ars[i].getState().toString().equals("Error")) {
         System.out.println(ars[i].getMessage());
         break;
        }
       }
  }
 }

 
What I'd like to do is instead of printing the Id, print the fullname of the Field or Object with that Id. Is it possible? What part of the api would I use? Also, I notice it doesn't show the status of every component I use in the Metadata array. Would it be possible to show the status of every component?


Message Edited by Gillberg on 05-27-2008 01:27 PM
SuperfellSuperfell
The Id in the AsyncResult is tied to your initial request, it has no long term relationship to any data on the server side.

If you want to map from the AsyncResult Id to the field or object name, then you'll need map between the 2 after the initial create/update call (i.e. if you called create with 5 fields, you got back 5 async results, the first one is for the first field etc).