Dynamics 365 CRM Connected Field Service 自动发送command
上期降到了怎样部署connected field service(CFS)
我们假设现在IoT 设备是温度监控器, 当温度触发我们之前预设的温度值, IoT会通过IoT Hub 发送IoT Alert到CFS中。 第一次触发, 系统会自动发送reboot的command。
为了有更好的用户体验, 我们需要自动发送command。
自动发送非常简单。
首先,我们需要创建一个workflow
我们的workflow需要在IoT Alert创建的时候触发。
这个workflow需要有以下两步:
1. 获取到当前IoT Alert的GUID
2. 创建IoT device command 并且把IoT Alert的GUID 绑定进去。
首先我们需要创建workflow。
如果不清楚workflow的,可以查看我的workflow 扫盲贴 Step by Step 开发dynamics CRM
public class RetrieveCFSData : CodeActivity
{
[Input("Key")]
public InArgument<string> Key { get; set; } [ReferenceTarget("msdyn_iotalert")]
[Output("IoTAlertId")]
public OutArgument<EntityReference> IoTAlertId { get; set; } protected override void Execute(CodeActivityContext executionContext)
{
//Create the tracing service
ITracingService tracingService = executionContext.GetExtension<ITracingService>(); //Create the context
IWorkflowContext context = executionContext.GetExtension<IWorkflowContext>();
IOrganizationServiceFactory serviceFactory = executionContext.GetExtension<IOrganizationServiceFactory>();
IOrganizationService service = serviceFactory.CreateOrganizationService(context.UserId); if (context.InputParameters.Contains("Target") && context.InputParameters["Target"] is Entity)
{
// Obtain the target entity from the input parameters.
Entity iotAlert = (Entity)context.InputParameters["Target"];
var alertId = iotAlert.Attributes["msdyn_iotalertid"].ToString();
//Update Record by using Custom Assembly output parameter
var iotAlertRef = new EntityReference("msdyn_iotalert", new Guid(alertId));
iotAlertRef.Name = "Hello World From Workflow";
IoTAlertId.Set(executionContext, iotAlertRef);
} }
}
我们把这个workflow添加到之前简历好的step当中。不用set properties
并且,我们要创建一个IoT Device Command 的step。
在这个step当中, 我们需要在operator找到我们创建好的step 1 custom workflow。
并且把parent alert 做绑定。
Dynamics 365 CRM Connected Field Service 自动发送command的更多相关文章
- Dynamics 365 CRM Connected Field Service 不能接收IoT Alert
今天浪费了2,3个小时再connected field service(CFS)上面. 状况如下 1. 在CFS中添加了新的customer assets,并且点击了注册按钮. 2. 注册步骤一直在i ...
- Dynamics 365 CRM 配置field service mobile
配置field service mobile其实微软是有官方文档的, 但是没有坑的微软产品不是好产品. 一些细节设置文中还是没有考虑到的. 所以这里带大家配置一下field service mobil ...
- Dynamics 365 CRM 部署 Connected Field Service
微软 Connected Field Service 是一个提供Azure IoT 和 Dynamics 365 连接的这样一个框架 有两种方式部署CFS, 一种是用IoT Hub PaaS, 一种是 ...
- Dynamics 365 CRM 在 Connected Field Service 中部署 IoT Central (一)- 配置 IoT Central和IoT alert
今天这个系列给大家带来怎样在connected field service中部署IoT Central 并且做连接. 首先, 这里提供微软官方的tutorial的链接https://docs.micr ...
- Dynamics 365 CRM 在 Connected Field Service 中部署 IoT Central (二)- 匹配设备
上个blog中介绍了我们怎么去部署IoT central和 connected field service做连接. 我们这次介绍怎么把IoT设备在CRM中怎么去注册. 首先我们打开devices,再选 ...
- Dynamics 365 CRM 在 Connected Field Service 中部署 IoT Central (三)- 发送 work order 和 booking 信息给 IoT Central
首先, 我们可以打开IoT alert, 并且点击上的 create a flow. 接下来,我们使用微软准备好的模板:Sample Contoso- When a work order is cre ...
- Dynamics 365 CRM 开发架构简介
Dynamics 365 CRM提供了多种编程模型,你可以灵活地按需选用最佳模式. 本文是对Dynamics 365 CRM编程模型的综述. 概览 下图表明了Dynamics 365 CRM的主要可编 ...
- Dynamics 365 CRM Free up storage 清理Dynamics 365 CRM的空间
Dynamics 365 CRM 的空间是要买的. 但是很多情况下用户可以去清理CRM从而达到给空间减重的方法 两大使用DB空间大的功能 1. Audit log 审计记录 审计记录是用来记录各个fi ...
- Dynamics 365 CRM large instance copy
使用CRM 大家想必都做过copy. 从一个instance 复制到另外一个instance. 如果你是Dynamics 365 CRM 用户, 并且你的instance超过500GB,甚至1TB+的 ...
随机推荐
- one troubleshooting case about em access issue
Today when trying to open my Oracle EM url, I can not open it. So I thought may be the network is ha ...
- [JavaEE] Testing the Java EE Application : Basic Arquillian integration test
We have model like this: package com.pluralsight.bookstore.model; import javax.persistence.*; import ...
- JavaScript设计模式 Item9 --适配器模式Adapter
适配器模式(转换器面模式),通常是为要使用的接口,不符本应用或本系统使用,而需引入的中间适配层类或对象的情况. 适配器模式的作用是解决两个软件实体间的接口不兼容的问题. 一.定义 适配器模式(Adap ...
- sgu101Domino
给你一些边,假设存在欧拉路径就打出来 我的代码例如以下: #include<iostream> #include<cstring> using namespace std; i ...
- POJ_1679_The Unique MST(次小生成树模板)
The Unique MST Time Limit: 1000MS Memory Limit: 10000K Total Submissions: 23942 Accepted: 8492 D ...
- 在Tomcat服务器中去端口访问域名
在刚购买域名并解析后,从外网访问Tomcat服务器时是需要在域名后面加端口":8080".要去端口访问的步骤如下: 在Tomcat目录下的conf文件夹下,打开server.xml ...
- LeetCode 387. First Unique Character in a String (字符串中的第一个唯一字符)
题目标签:String, HashMap 题目给了我们一个 string,让我们找出 第一个 唯一的 char. 设立一个 hashmap,把 char 当作 key,char 的index 当作va ...
- 苹果官方Instruments工具之Automation的介绍
instruments中国的工具測试有非常多,包含非常多方面.eg:内存泄露的測试.网络连接.和cpu内存的使用情况一系列数据的图形界面的显示. 功能的介绍能够看以下的截图图片: watermark/ ...
- QT信号槽与Delphi事件的对比
最近学QT,对信号槽机制感到有点新鲜: QObject::connect(slider, SIGNAL(valueChanged(int)), lcd, SLOT(display(int))); 自己 ...
- Algorithmic Crush
evendra在9号云上看到了他的教练朝他微笑. 每次教授选出Devendra单独问他一个问题,Devendra朦胧的头脑里全是他的教练和她的微笑,以至于他无法专注于其他事情.帮助他解决这个问题: 给 ...