Exemplo n.º 1
0
        public static void CreateServiceAlert(IConfigurationProvider configurationProvider,
                                              Guid eventToken, string deviceId, string actionId)
        {
            Trace.TraceInformation("ActionProcessor: In CreateAlert V3");

            IOrganizationService service = TryGetOrgService(configurationProvider);

            EntityReference asset = new EntityReference(CrmTypes.f1_customerasset.EntityLogicalName,
                                                        new Guid(deviceId));

            CrmTypes.new_servicealert serviceAlert = new CrmTypes.new_servicealert
            {
                new_name       = String.Format("Az_SampleAlert {0} {1}", actionId, count.ToString()),
                new_AlertToken = eventToken.ToString(),
                new_Asset      = asset
            };

            service.Create(serviceAlert);
            count++;
        }
        public static void CreateServiceAlert(IConfigurationProvider configurationProvider,
                                        Guid eventToken, string deviceId, string actionId)
        {
            Trace.TraceInformation("ActionProcessor: In CreateAlert V3");
            
            IOrganizationService service = TryGetOrgService(configurationProvider);
            
            EntityReference asset = new EntityReference(CrmTypes.f1_customerasset.EntityLogicalName,
                                                        new Guid(deviceId));

            CrmTypes.new_servicealert serviceAlert = new CrmTypes.new_servicealert
            {
                new_name = String.Format("Az_SampleAlert {0} {1}", actionId, count.ToString()),
                new_AlertToken = eventToken.ToString(),
                new_Asset = asset
            };

            service.Create(serviceAlert);
            count++;
        }