$ActivityStream.Post

Overview

Posts a new activity entry on a object. Object properties are defined in ActivityEntry.

string $ActivityStream.Post(activity: ActivityEntry)

Arguments

ActivityEntry activity

Returns

Id of the activity entry.

Example

Creating a basic activity for everyone.

$ActivityStream.Post({ objectId : $Xml.Evaluate('Id') objectType : 'customer', content: 'Customer ' + $Xml.Evaluate('Name') + ' is updated.' });

Example

Creating a activity to display only to administrators.

$ActivityStream.Post({ objectId : $Xml.Evaluate('Id') objectType : 'customer', content: 'Customer is updated.', targets: [ $Membership.Administrator ] });

Example

Create a new activity to display only to administrators and accounting with exclusively notify the accounting.

$ActivityStream.Post({ objectId : $Xml.Evaluate('Id') objectType : 'customer', content: 'Customer is updated.', targets: [ { targetId: $Membership.Administrator }, { targetId : $Membership.FindIdentity('Accounting'), notify: true } ] });

Example

Create a new activity with file attachment.

Example

Create a new activity on a case

Types

ActivityEntry

Activity entry

{ // Specifies the type of activity. @type : string // Specifies the actor of activity. actor : ( string | Identity ) // Array of activity attachments. attachments : Array<( string | ActivityEntryAttachment )> // Specifies the id of object that activity is related to. Required. objectId : string // Specifies the type of object that activity is related to. Required. objectType : string // Specifies the date time of activity. Default value is current date time. publishedAt : DateTimeOffset }

ActivityEntryAttachment

Attachment of an activity

{ // Type of the attachment. Default value is "file". @type : ( "file" | "link" | "video" ) // File id of the attachment id : string }

Copyright © 2010 - 2023 Emakin. All rights reserved.