user1119341
user1119341

Reputation: 11

Salesforce Metadata apis

I want to rerieve list of Metadata Component's like ApexClass using Salesforce Metadata API's.

I'm getting list of all the Apex Classes(total no is 2246) that are on the Salesforce using the following Code and its taking too much time to retrieve these file names:

ListMetadataQuery query = new ListMetadataQuery();
query.type = "ApexClass";
double asOfVersion = 23.0;

// Assume that the SOAP binding has already been established.

FileProperties[] lmr = metadataService.listMetadata(
         new ListMetadataQuery[] { query }, asOfVersion);


if (lmr != null)
{
    foreach(FileProperties n in lmr)
    {
        string filename = n.fileName;
    }
}

My requirement is to get list of Metadata Components(Apex Classes) which are developed by my organizasion only so that i can get the Salesforce Metadata Components which are relevant to me and possibly can save my time by not getting all the classes.

How can I Achieve this?

Reply as soon as possible.

Thanks in advance.

Upvotes: 0

Views: 1665

Answers (1)

Matt Lacey
Matt Lacey

Reputation: 8255

I've not used the meta-data API directly, but I'd suggest either trying to filter on the created by field, or use a prefixed name on your classes so you can filter on that.

Not sure if filters are possible though! As for speed, my experience of using the Meta-Data API via Eclipse is that it's always pretty slow and there's not much you can do about it!

Upvotes: 1

Related Questions