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
laluzlaluz 

describeSObject

Hey!

Is there a way to extend the sforce API to support "bundled" requests? It's taking so much time to query a describeSObject about every single existing object seperately. The huge SOAP overhead could be reduced dramatically minimizing time, and costs.

....for the API is really slow compared to others like UPS, where the business logic is much more complicated!

Cheers,

Sebastian

Nikki.ax79Nikki.ax79
Sebastian,

There is a describeGlobal call that will return all the objects available at once. It is a lot faster than calling each object one by one. I have sample code if you use/know Java. Salesforce also provides samples in C++ I think.

-Nikki
darozdaroz


Nikki wrote:
There is a describeGlobal call that will return all the objects available at once. It is a lot faster than calling each object one by one. I have sample code if you use/know Java. Salesforce also provides samples in C++ I think.


Nikki,

I don't believe that is correct. describeGlobal() only returns the encoding, maxBatchSize, and an array of strings containing the names of the objects in the system. If you need the metadata for those objects you still need to call describeSObject() for each one you need...

laluzlaluz

You're right. an describeGlobal won't help me that much. For sure I do need to execute that one to get an array of all available objects. But to retrieve the metadata I do need a faster way...

So please, maybe for the winter release, it would help so much, for the API is pretty cool and easy, but is not that suitable for complex application development. I feel like you need to code so many things yourself that it's both getting really complicated and pretty slow.

Sebastian

adamgadamg
Hi laluz-

in the interest of getting your feedback, can you provide us with more detail of what you are trying to do? In my experience describe executes pretty quickly... I would expect it should return in 200-400 ms, if not less. Is performance the issue that prevents you from doing complex applications, or are you finding the API hard to use?

Adam
darozdaroz

As an example I have a customer who does invoicing from Salesforce. Invoices are printed using a .net control from a WIL in Salesforce. The main invoice object has 3 child objects (line items, payments, and activities(don't ask how much of a PITA it is to associate an Event/Task to a custom object)). The invoice object itself is a child of an Account object. It also has several lookup relationships to the contact object, opportunity object, and a custom installed product object. The invoice uses data from all 9 objects (invoice, line item, payment, invoice activity, event, task, installed product, contact, & opportunity) when it prints.

Now to properly handle query building for these objects, and make them a but more future proof I pull down the describeSObject() result for each of the 9 objects. At last count that takes about 3-5 seconds each time the invoice control is loaded. If you could pass an array of object names to return the latency involved in setup and tear down, as well as auth-check, etc. would be reduced alot -- probably to under a second for the whole shebang.

laluzlaluz

Hi Adam,

The main goal is to develop a dynamic synchronization agent to an SQL database. For our data structure and functionality in salesforce evolves more and more, we need to adopt or sync interface very often. That for and because we are about to establish a data hub in the near time future, we like to develop an dynamic sync interface with the data hub's core. Which means, fields have to be generated automatically, classes to be extended, activity needs to be recorded, and so on...

For some informations are very important to be most up-to-date, they need to be pulled as fast as possible meaning to compare/update the structure as well.

I do think it to be a bit inconsistent to return all matching records in a QueryResult, but the need to request the structure of every single SObject seperately. I believe, designing the describe* like the query/queryMore would be pretty cool. Or another API point to return an array of a combined describeGlobal/SObject result.

The same is for the getUpdated, actually. For getDeleted it's sufficient to have both a record id and a timestamp. But the result of getUpdated is pretty funny. For you don't get a timestamp though you pass the same arguments as to getDeleted. However, you have to query for every single id, thus producing a large overhead. A work-around could be building a very long SOQL statement, which is limitied by 10'000 chars as is.

I do think performance and time is a big deal. More than ever when dealing with customers and needing the most up-to-date status report on a account in almost real-time, which cannot be created with salesforce due to the complexness.

A minor issue is a missing function to invalidate a session id (logging out) explicitly.

To retrieve a list of all available objects (describeGlobal) and getting the type def (describeSObject) with each result row takes 94 seconds. The bandwidth of our corporate connection is 6MBit/s (usage at 20-30% max), which should be sufficient... ;-)

 

Cheerio,

Sebastian

adamgadamg
I've seen code that does similar things, so I understand the use case.

I'm still not sure if there is a performance issue; even if it does take 94 seconds to compare the entire sforce schema with your local schema, that doesn't sound too unreasonable, and given that schema should only change very infrequently, if you run that operation once a night/etc I'd think that would be ok.

That said, I understand how knowing there is a schema/object change would be useful rather than having to discover it manually..
benjasikbenjasik
Thanks for the suggestions.

FYI, if you have an array of IDs from getUpdated, you can use the retrieve call (rather than a big soql call)