locked
How to validate using Plug In?? RRS feed

  • Question

  • Hi All,

     

    Can anyone please tell me how to validate any form fields in CRM 4.0 using Plug In??? Give some other scenario also..

    Thursday, March 17, 2011 7:56 PM

Answers

  • That's very vague question.  Have you read through the CRM 4.0 SDK?  There are a number of example plugins and walkthroughs in it:

     

    Introduction to Plug-in Development for Microsoft Dynamics CRM 4.0

     

    Plug-in Sample Code

     

    Creating a Simple Plug-in

    As for "how to validate any form fields", that depends entirely on what form field validation means to your specific requirements.  If, for example you register your plugin on the Synchronous Pre-Event "Create" message for the "Account" entity, you could check via the Target's InputProperties collection, the value of each attribute and throw an InvalidPluginExecutionException if you encounter data that your plugin isn't happy with.

    The error message you supply the Exception constructor will be displayed to the User and the create will be rolled back.

     

     

     


    --pogo (pat)
    Thursday, March 17, 2011 9:44 PM