Beispiel #1
0
 public void GetMessageId()
 {
     using (CrmServiceContext _context = new CrmServiceContext(this._addon.ServiceClient))
     {
         this._addon.g_MessageId = _context.CreateQuery("sdkmessage")
                                   .Where(s => s.GetAttributeValue <string>("name").Equals(this._addon.s_Event))
                                   .Select(s => s.GetAttributeValue <Guid>("sdkmessageid"))
                                   .First();
     }
 }
Beispiel #2
0
 public void GetFilterId()
 {
     using (CrmServiceContext _context = new CrmServiceContext(this._addon.ServiceClient))
     {
         this._addon.g_FilterId = _context.CreateQuery("sdkmessagefilter")
                                  .Where(s => s.GetAttributeValue <string>("primaryobjecttypecode").Equals(this._addon.s_EntityName) &&
                                         s.GetAttributeValue <EntityReference>("sdkmessageid").Id.Equals(this._addon.g_MessageId))
                                  .Select(s => s.GetAttributeValue <Guid>("sdkmessagefilterid"))
                                  .First();
     }
 }