CreateArticle
Creates an article for display on the home page or news feed.
Syntax
CreateArticle(category, subject, description)
Parameters
- category (string): Article category/tag (e.g., “Company News”, “Updates”, “Announcements”)
- subject (string): Article title/subject
- description (string): Article content/description
Returns
- boolean:
trueif article creation was initiated,falseon error
Description
Creates a news article that appears on the home page or news feed. Articles are created asynchronously (fire-and-forget) and will appear in the tenant’s article list. Useful for automatically posting announcements when certain domain events occur.
Examples
# Announce new organization creation
AfterOrganizationCreated:
CreateArticle(
"Company News",
"New Organization Created",
"Welcome " + Data.Organization.Name + " to our platform!"
)
# Post system maintenance notice
CreateArticle(
"System Updates",
"Scheduled Maintenance Tonight",
"The system will be unavailable for maintenance tonight from 10pm to 2am EST."
)
# Announce new feature
CreateArticle(
"Announcements",
"New Reporting Feature Available",
"We've added a new reporting feature that allows you to export data in multiple formats. Check out the Reports menu to get started!"
)
# Conditional article creation
AfterPersonCreated:
# Only announce VIP member joins
var emailParts = Data.Person.EmailAddress.split("@")
var domain = emailParts[1]
if domain == "vip-partner.com" then
CreateArticle(
"Partner News",
"New VIP Partner Member",
"Please welcome " + Data.Person.FirstName + " " + Data.Person.LastName + " from our VIP partner organization!"
)
end
# Weekly summary article
var orgs = GetAllOrganizations()
var activeCount = 0
foreach org in orgs do
if org.isActive then
activeCount = activeCount + 1
end
end
CreateArticle(
"Weekly Summary",
"Platform Statistics",
"Current active organizations: " + activeCount
)
Best Practices
- Keep categories consistent - Use a defined set of categories for better filtering
- Write clear subjects - Subjects appear in lists and should be descriptive
- Keep descriptions concise - Articles are meant for quick reading
- Use sparingly - Avoid creating too many articles that overwhelm users
Related Functions
- BroadcastNotification - For real-time alerts
- SendNotification - For user-specific alerts