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
priyankasingla3101.3916265522429534E12priyankasingla3101.3916265522429534E12 

Streaming API : Does change in ApiVersion affect subscriptions of existing pushtopic?

Hi,
I have a pushtopic in salesforce that has been created with version 31.0, now my Salesforce version has been upgraded to 32.0. Does the change in the version affect the subscriptions anyhow?
Exactly what I want to know is, what is the use of apiVersion field of Pushtopic, where does it come into picture?

Thanks
Priyanka Gupta
BalajiRanganathanBalajiRanganathan
Below is from the PushTopic documentation for the ApiVersion field on the Push Topic.

Required. API version to use for executing the query specified in Query. It must be an API version greater than 20.0. If your query applies to a custom object from a package, this value must match the package's ApiVersion.

Basically it tells that the Query(SOQL) used in the Push Topic was written as per the available features from API version spcified in the ApiVersion Field.

Most the features are backward compatible. ie. the Query return in 31.0 API will work on 32.0. so you should be good in updating this field. also if you update the API field to 32.0 then optionaly you can update your query with any new features availabe in API 32.0.



 
PratikPratik (Salesforce Developers) 
Hi Priyanka,

API Version in the pushtopic suggests the api version that you want to use. The significance of API Version is the feature set available. 

For e.g.
In API version 28.0 and earlier, notifications are only generated when records are created or updated. The NotifyForOperationCreate, NotifyForOperationUpdate,NotifyForOperationDelete, and NotifyForOperationUndelete fields are unavailable and the NotifyForOperations enum field is used instead to set which record events generate a notification.

Lokewise features and functionality upgrades with version. You can set you pushtopic version (pushTopic.ApiVersion = 32.0;).

Hope this will help you!

Thanks,
Pratik
 
BalajiRanganathanBalajiRanganathan
The value pushTopic.ApiVersion field affects only the SOQL. it does not affect the fields available to create push topic. The fields available are depends on at which API version the PushTopic code is executed(Ananymous Execution) or stored (inside a class file with API version)