locked
How to give validate new record in entity depend on two option control? RRS feed

  • Question

  • Hi All,

    I want to know how to create validate code to give a condition when two option is true, we can create new record in entity which have relationship N : N with own entity and and the opposite if two option value is false.

    anyone have suggestion?

    thanks,

    -Rory Glo.

    Friday, December 2, 2011 8:17 AM

Answers

  • Yes Rory

    There are 2 ways

    (1) Client Side Validation, you can Write javascript OnSave Entity to Validate your records. you can write your logic in Javascript which will validate user data

    (2) you can write Plugin in C# or VB and then register plugin on Pre image so it will execute before records get saved. in your validation logic you can throw message or you can cancel the Save event.

     

     


    Many Thanks -Bhautik Desai xRM Technologies
    • Proposed as answer by Bhautik Desai-XRM Tech Friday, December 2, 2011 10:21 AM
    • Marked as answer by pntr Sunday, December 4, 2011 10:48 AM
    Friday, December 2, 2011 10:21 AM

All replies

  • Yes Rory

    There are 2 ways

    (1) Client Side Validation, you can Write javascript OnSave Entity to Validate your records. you can write your logic in Javascript which will validate user data

    (2) you can write Plugin in C# or VB and then register plugin on Pre image so it will execute before records get saved. in your validation logic you can throw message or you can cancel the Save event.

     

     


    Many Thanks -Bhautik Desai xRM Technologies
    • Proposed as answer by Bhautik Desai-XRM Tech Friday, December 2, 2011 10:21 AM
    • Marked as answer by pntr Sunday, December 4, 2011 10:48 AM
    Friday, December 2, 2011 10:21 AM
  • Hi Bhautik,

    is possible if i want to disable true/false the button to add new record in ribbon?

    thanks.

    -Rory Glo.

    Saturday, December 3, 2011 5:24 AM
  • Yes Rory

    Using Javascript client validation you can achive this

     

     


    Many Thanks -Bhautik Desai xRM Technologies
    Saturday, December 3, 2011 10:14 AM