Changes

→‎Watching: section added
Line 209: Line 209:     
''NOTE: currently (2007-07-25) the query is ignored in this call, it looks for all values in all entries. And in more recent Sugar versions, the only property allowed is 'activity'.''
 
''NOTE: currently (2007-07-25) the query is ignored in this call, it looks for all values in all entries. And in more recent Sugar versions, the only property allowed is 'activity'.''
 +
 +
==Watching==
 +
 +
To keep cached information in your activity up-to-date, you can subscribe to these signals:
 +
 +
datastore.Created(object_id)
 +
datastore.Updated(object_id)
 +
datastore.Deleted(object_id)
 +
 +
E.g. if you display a document title in your activity, and the user changes that entry in the Journal while your activity is running, you can use the Updated signal to reflect that change. Otherwise, when you save the document, it will overwrite the title set by the user.
 +
 +
Similarly, if you display a list of Journal entries in your activity, it would have to be updated in response to the Created and Deleted signals.
    
==Progress Display==
 
==Progress Display==
132

edits