7 Replies Latest reply on Nov 27, 2017 5:56 PM by mdspath

    Add trigger onto NotificationRuleTemplate

    MikeSpath

      Hello:

      I'm a bit stuck on how to complete my building of templates via the sdk. Below is code that creates a new NotiifcationRuleTemplate, my question is how to add the analysis template for the trigger.

                 // Create Element Template

                  AFElementTemplate elmTemplate = db.ElementTemplates["ETma001"];

                  if (elmTemplate == null)

                  {

                      elmTemplate = db.ElementTemplates.Add("ETma001");

                      elmTemplate.InstanceType = typeof(AFElement);

                  }

                  elmTemplate.CheckIn();

                   AFNotificationRuleTemplate myAFRTtemplate = new AFNotificationRuleTemplate("MyNRTtemplate#2", elmTemplate, createEnabled: true);

                  // have to add a trigger

                  myAFRTtemplate.CheckIn();