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
zgcharley_09zgcharley_09 

The problem of activation to my account

Hello,

 

I received the mail that my account has been activated for Streaming API. I checked the Setup -> Customize -> User Interface and found the "Streaming API" is enable. However, i got  error when I executed query string "Select Name From PushTopic" through my client.

 

Error info:

[ INVALID_TYPE: sObject type 'PushTopic' is not supported. ].

 

What's the status of my account? Has been activated for Streaming?

 

Thanks

zg

Best Answer chosen by Admin (Salesforce Developers) 
bob_buzzardbob_buzzard

You can select this information, but you need to make sure you are using version 22.0 of the API.

 

E.g. when executing the following:
 

List<PushTopic> pts=[Select Name From PushTopic];
System.debug('### Topics - ' + pts);

 

If I execute anonymous from the force.com IDE (eclipse), this is still at version 21.0, so I receive the following error:

 

Compile error at line 1 column 21
sObject type 'PushTopic' is not supported.

 

However, executing from the system log runs at API 22.0, so I see the following debug output:

 

09:54:59.036 (36145000)|SOQL_EXECUTE_BEGIN|[1]|Aggregations:0|Select Name From PushTopic
09:54:59.039 (39689000)|SOQL_EXECUTE_END|[1]|Rows:1
09:54:59.039 (39846000)|SYSTEM_METHOD_ENTRY|[2]|System.debug(ANY)
09:54:59.040 (40026000)|USER_DEBUG|[2]|DEBUG|### Topics - (PushTopic:{Name=AllAccounts, Id=0IFG00000004C9NOAU})

 

 

All Answers

sdetweilsdetweil

I don't think YOU can do the select yourself directly.

 

did you try the samples?

 

 

zgcharley_09zgcharley_09

Actually, I didn't select the 'Enable' checkbox by myself. It is in checked status when I opeing the 'User Interface'

sdetweilsdetweil

no.. you said you did  "Select Name From PushTopic".. that is not how this feature works.

 

you save a soql stmt and some parameters to a PushTopic item. Those are hidden from normal apex code.

when you 'subscribe' to a topic, by name, then salesforce uses the information to do the notification work.

 

I think you can only Insert or Delete a PushTopic.

 

 

 

 

bob_buzzardbob_buzzard

You can select this information, but you need to make sure you are using version 22.0 of the API.

 

E.g. when executing the following:
 

List<PushTopic> pts=[Select Name From PushTopic];
System.debug('### Topics - ' + pts);

 

If I execute anonymous from the force.com IDE (eclipse), this is still at version 21.0, so I receive the following error:

 

Compile error at line 1 column 21
sObject type 'PushTopic' is not supported.

 

However, executing from the system log runs at API 22.0, so I see the following debug output:

 

09:54:59.036 (36145000)|SOQL_EXECUTE_BEGIN|[1]|Aggregations:0|Select Name From PushTopic
09:54:59.039 (39689000)|SOQL_EXECUTE_END|[1]|Rows:1
09:54:59.039 (39846000)|SYSTEM_METHOD_ENTRY|[2]|System.debug(ANY)
09:54:59.040 (40026000)|USER_DEBUG|[2]|DEBUG|### Topics - (PushTopic:{Name=AllAccounts, Id=0IFG00000004C9NOAU})

 

 

This was selected as the best answer
zgcharley_09zgcharley_09

You are right. i forgot to upgrade the API to 22.0. Now, there's no error when I selecting the name from PushTopic with 22.0 API. For I don't create any PushTopic object yet so the result is 0(zero) record. I think it's correct.

 

Thanks for your reminder

Jack WigaJack Wiga
Hi,
You're also helpful posting and writting. Your can attempt DuplicateFilesDeleter program, straightforward, quick and takes care of the issue.

Thank you