[HTTP Trigger] How to post to MS Teams whenever a Sales Order is made

  • Updated

In this sample, we will show you how to post birthday wishes to Microsoft Teams from B1 Print and Delivery.

What you need:

  • B1 Usability Package 2019.04 or higher
  • A B1 Usability Package License
  • A Microsoft Teams account (you need to be owner/admin of the Channel you set it up in)
    • An incoming Webhook connector (See this video on how to make one)

Step by Step Setup:

  1. Go to Administration > Add-Ons > B1 Usability Package > Module Configuration > Universal Function > Universal Function Configuration
    • Create the following Configuration
      • In name write "New Awsome deal"
      • In URL enter the URL of you Microsoft Teams Webhook
      • Set template to "Microsoft Teams"
      • Leave Subject blank (not used in this sample)
      • Enter the following message 

        SQL(
        SELECT
        '<h1>'+T1.SlpName+' is awsome!.</h1><br/> <strong>Why?</strong><br/><br/> Because he/she just booked a new order with customer '+T0.CardName+', that why!' As 'Message'
        FROM ORDR T0
        JOIN OSLP T1 ON T0.SlpCode = T1.SlpCode
        WHERE T0.DocEntry = $[NEWID]
        )

        <img src="https://www.boyum-it.com/BoyumImageSamples/awsome.gif" />

        • You can tweak the SQL as you please and use another image if you please
  2. Go to Administration > Add-Ons > B1 Usability Package > Module Configuration > B1 Validation Configuration
      • Set name to "Awsome new sales!"
      • Set formType to "139" (Sales Order)
      • Set Event = "Data Add"
      • Set BeforeAction = "False"
      • Set No Condition, Just execute Function to The Universal Function you created in Step 1

Was this article helpful?

0 out of 0 found this helpful

Comments

0 comments

Please sign in to leave a comment.