Show / Hide Table of Contents

    How to send a message in a channel in Slack when voiding a sales order?

    The following is required to send a message in Slack when а sales order is voiding:

    • Webhook template set up according to the endpoint in Slack REST API.
    • User business rule configured to execute when a sales order is voiding.
    • The user business rule must define an action of type WEBHOOK, pointing to the code of the webhook template.

    Webhook template

    Below is an example of what the webhook template should contain.

    Attribute name Attribute value
    Code slack_void_01
    Name Slack - voiding a sales order
    Repository name Crm.Sales.SalesOrders
    URL https://slack.com/api/chat.postMessage?channel=<channel>&text=<{DisplayText}>
    Headers Authorization: Bearer <accessToken>
    Notes Sends a message in a Slack channel when a sales order is voiding.

    Where,

    • <channel> - the Slack channel where the message will be sent.
    • {DisplayText} - the message contents. It is also an interpolated string. It will be evaluated by ERP.net and will contain the display text of the sales order (e.g., Sales Order 00108).
    • <accessToken> - the access token provided from Slack.
    Note

    Body attribute is missing intentionally. It's not required.

    User business rule

    А business rule that triggers when a sales order is voiding.

    Repository
    Crm.Sales.SalesOrders
    Events
    Event type Event parameter Execution priority
    VOIDING Normal
    Actions
    Action No Action type Parameter1 type Parameter1 value
    1 WEBHOOK Constant slack_void_01

    See more

    • User business rules
    • String interpolation
    • Display format
    • Slack API Reference
    • Slack access tokens
    • Improve this Doc
    Back to top Generated by DocFX