Can't access to related records on pre-delete plug-in RRS feed

  • Question

  • Hi


    I have a LINQ query which works on Pre-Update step and does not work on Pre-Delete step.

    the query is very simple, it just gets a list of appointments related to another entity (via some another entites)




                IEnumerable<Guid> currApps = from a in this.OrgContext.AppointmentSet
                               join pao in this.OrgContext.preactivityobjectiveSet on a.ActivityId.Value equals pao.AppointmentId.Id
                               join paot in this.OrgContext.preactivityobjectivetemplateSet on pao.cdm_PreActivityObjectiveTemplateId.Id equals paot.preactivityobjectivetemplateId.Value
                               join pat in this.OrgContext.preactivitytemplateSet on paot.PreActivityTemplateId.Id equals pat.preactivitytemplateId.Value
                               where pat.preactivitytemplateId.Value == id
                               select a.ActivityId.Value;

    when this plug-in executes on pre-update it gets correct list of ID-s, but on pre-delete - does not.

    interesting thing that i started SQL profiler, grabed the query and executed it aftewwards it gived me a correct (not-blank) result.


    do you have any ideas?


    P.S. I tried it both on rollup 2 and rollup 3


    Tuesday, August 2, 2011 10:04 AM


All replies