locked
Plugin not firing on PreValidation of Service Activity in crm2013 RRS feed

  • Question

  • Hi ,

    I have plugin registered on PreCreate and stage number 10 for validation some field on service Activity Entity. however i noticed if we create  Service Activity record using OOB Scheduler (From Service Calender and Scheduling Service Activity ) Plugin doesn't get fired . I wonder if Sevice Scheduling engine making some hindrance to executing custom plugin .However if same plugin register on stage 20 (Preoperation) on same entity and create service activity record which triggers plugin  then system shows error "General Failure in Scheduling engine".If plugin condition doesn't match it doesn't show any error .

    i observe when custom plugin logic fired (stage 20) then General failure error occurs , I want to do data validation before Service Activity created( i have to check whether location is selected then only allow user to save service activity)  ,How can i achieve this . If i unregistere plugin no error occurs . 


    Prashanth M..J

    Monday, February 22, 2016 9:29 AM

All replies

  • The CRM UI also calls the Book message when creating a Service Activity, so you could try registering your plugin on the Book event.

    However, if all you need to do is ensure the location field has a value, you could just make it a mandatory field. Or, if the logic is a bit more complicated, you could use client script in the OnSave event


    Microsoft CRM MVP - http://mscrmuk.blogspot.com/ http://www.excitation.co.uk

    Monday, February 22, 2016 9:46 AM
    Moderator
  • Hi,

    I've seen this as well, it seems that sometimes the pre-validation step isn't triggered but if you register it on pre operation it works. Very weird. The issue might be that you're inside the transaction with the pre operation stage.

    Regards


    Rickard Norström Developer CRM-Konsulterna
    http://www.crmkonsulterna.se
    Swedish Dynamics CRM Forum: http://www.crmforum.se
    My Blog: http://rickardnorstrom.blogspot.se

    Tuesday, February 23, 2016 8:24 AM