locked
context.getEventArgs().preventDefault(); - Decision? RRS feed

  • Question

  • I have a piece of code that if the same account code already exists then CRM won't allow the new record to save

    The code included the piece of code in the title that brings up a save/cancel option

    What I would like to know is that if the user clicks cancel I want some further code to execute, how would I do this?

    Thanks, Shaun


    S.Harrison

    Thursday, June 5, 2014 2:23 PM

All replies

  • İf you want to check the the account is already exist or not , it is not a good way implementing with javascript. You should use Plugins of the Crm. Like PreAccount or PreValidate message.
    Thursday, June 5, 2014 3:21 PM
  • It's too my understanding that its only not good practise to use javascript if there are other means of creating accounts for example in CRM

    In my case the only way to create accounts is through CRM therefore javascript works fine.

    However I've changed my code now to run when the text is changed in the field therefore I don't need an answer to this question

    Thank you though for your advice

    Thanks, Shaun


    S.Harrison

    Thursday, June 5, 2014 3:26 PM