locked
Case validation CRM 2013 SP1 RRS feed

  • Question

  • Hello,

    Using the following code with CRM 2013 SP1 the statuscode (5) is being ignored:

    function FrmOnSave(context) { 
      if (context != null && context.getEventArgs() != null) {
            var saveMode = context.getEventArgs().getSaveMode();
            alert('SaveMode : ' + saveMode);
            if (saveMode == "5") {
                // Validation code
                alert('Form is not valid');
            }
        }
    } 

    The 'SaveMode' always returns 1.

    Any help would be appreciated.

    Duane

    Monday, October 13, 2014 10:14 AM

All replies

  • Hi Duane,

    Please refer the following link for various save modes. 5 is the save mode when case is Resolved.

    Please check


    Regards, Saad


    • Edited by Mohd Saad Monday, October 13, 2014 11:10 AM
    Monday, October 13, 2014 11:00 AM
  • Hi Saad,

    I am expecting to have a value of 5 returned and under CRM 2011 the above code returns 5 when I resolve the Case, but CRM 2013 SP1 is not. I know the code is running as the first alert is returning the value 1.

    Thanks

    Duane

    Monday, October 13, 2014 1:39 PM