exception - Why does Salesforce prevent me from creating a Push Topic with a query that contains relationships? -


when execute code in developer console

pushtopic pushtopic = new pushtopic(); pushtopic.apiversion = 23.0; pushtopic.name = 'test'; pushtopic.description = 'test'; pushtopic.query = 'select id, account.name case'; insert pushtopic; system.debug('created new pushtopic: '+ pushtopic.id); 

i receive message:

fatal error system.dmlexception: insert failed. first exception on row 0; first error: invalid_field, relationships not supported: [query]

the same query runs fine on query editor, when assign push topic invalid_field exception.

if bottom line exception message says, relationships not supported push topic objects, how create push topic object return data i'm looking for?

why

salesforce prevents because require them join tables, joins in salesforces database expensive due multi-tenancy. when add new feature not support joins requires more optimization of feature.

push topics still quite new system , need real time, slow them down i'd needs trimmed.

i'd suggest more closely @ requirement , see if there else work you.

workaround

a potential workaround add formula field case object data need , include in query instead. may not work still require join work.

a final option may use workflow rule or trigger update account name custom field on case object way data local doesn't require join...


Comments

Popular posts from this blog

c++ - Creating new partition disk winapi -

Android Prevent Bluetooth Pairing Dialog -

php - joomla get content in onBeforeCompileHead function -