0

I'm not sure if what I am doing is possible but I would like to find out. I am connecting to my sandbox environment through the Force.com Streaming API (and Oauth2) using a Nodejs server and the nforce library.

Is it possible to detect changes in a Case using the Streaming API if only an attachment is added, changed, removed or in any other way modified? Is it an nforce issue where it only picks up specific API triggers? For the case, it will fire on anything under Case Detail and Additional Information edits, but will not fire on Solutions, Open Activities, Activity History, Case Comments or Attachments. How can I pick up changes to these parts of a case through the Streaming API (if it's even possible)?

The following is my current PushTopic:

pushTopic.Name = 'NAME';
pushtopic.Query = 'SELECT Id, Subject FROM case';
pushTopic.ApiVersion = 32.0;
pushTopic.NotifyForOperationCreate = true;
pushTopic.NotifyForOperationUpdate = true;
pushTopic.NotifyForOperationUndelete = true;
pushTopic.NotifyForOperationDelete = true;
pushTopic.NotifyForFields = 'All';

If this is not achievable through the Streaming API, is there an alternate method that I should investigate? What I want is the application listen for changes in the attachments for my cases and be notified when those changes occur.

0

Since I am looking for changes in attachments, I have decided to use APEX inside my SalesForce dev environment to implement an APEX trigger that would catch the inserted or updated attachments as they are being attached/changed.

trigger InterceptAttachment on Attachment (before insert, before update) 
{
    //Do Stuff
}

From here I can have the trigger a change in the case by doing a simple update call and that will end up triggering the Streaming API. As far as I have seen in the documentation, the Streaming API does not support listening in on attachment changes at the time of this answer.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.