locked
How to make the notes field compulsory ? RRS feed

  • Question

  • I want to make the notes field of contracts compulsory...anyway to do that ?
    It doesn't seem to appear as a normal field in the custom field listings...
    Tuesday, May 29, 2012 3:16 AM

Answers

  • The time-stamped notes in a record is its own record type in CRM so the characteristics of the normal form fields (being able to require etc...) don't apply. I'm not sure you'd even be able to add some custom JavaScript to the form save event to verify a note was present because if I'm not mistaken the parent record would have to save first before the note would get saved if both were created during the initial record creation. With this happening, any logic to check for the presence of a related note would fail. You might be better off structuring the data you wish to capture into new "standard" form fields and use the built in ability to require them. 

    Jason Lattimer

    Tuesday, May 29, 2012 3:36 AM
    Moderator
  • You code use code similar to this on the form's Save event to generate an alert. In particular, this will only fire the first time the form is saved:

    function OnSave() {
        if (Xrm.Page.ui.getFormType() == 1) {
            alert("Attach the scanned copy");
        }
    }
    

    Jason Lattimer

    • Marked as answer by boo oinky Wednesday, May 30, 2012 5:03 AM
    Tuesday, May 29, 2012 1:07 PM
    Moderator

All replies

  • The time-stamped notes in a record is its own record type in CRM so the characteristics of the normal form fields (being able to require etc...) don't apply. I'm not sure you'd even be able to add some custom JavaScript to the form save event to verify a note was present because if I'm not mistaken the parent record would have to save first before the note would get saved if both were created during the initial record creation. With this happening, any logic to check for the presence of a related note would fail. You might be better off structuring the data you wish to capture into new "standard" form fields and use the built in ability to require them. 

    Jason Lattimer

    Tuesday, May 29, 2012 3:36 AM
    Moderator
  • we need to ensure that post contract creation, the service maintenance admin attaches a scanned copy of the contract to notes.
    Any way to generate a sort of reminder pop up before the contract is saved and closed reminding the staff to remember to upload the contract ??

    Tuesday, May 29, 2012 4:51 AM
  • You code use code similar to this on the form's Save event to generate an alert. In particular, this will only fire the first time the form is saved:

    function OnSave() {
        if (Xrm.Page.ui.getFormType() == 1) {
            alert("Attach the scanned copy");
        }
    }
    

    Jason Lattimer

    • Marked as answer by boo oinky Wednesday, May 30, 2012 5:03 AM
    Tuesday, May 29, 2012 1:07 PM
    Moderator