locked
Setting Bit Field to Null on form load in 2011 RRS feed

  • Question

  • I'm trying to set a custom bit field on my phone call form to Null in order to force a user to select one of the two options. I've found various methods of achieving this but none seem to work. This is the one that seemed to come closest:

    function SetNullPhoneType () {

     var FORM_TYPE_CREATE = 1;
     var FORM_TYPE_UPDATE = 2;
     var FORM_TYPE_READ_ONLY = 3;
     var FORM_TYPE_DISABLED = 4;
     var FORM_TYPE_QUICK_CREATE = 5;
     var FORM_TYPE_BULK_EDIT = 6;
     var FORM_TYPE_READ_OPTIMIZED = 11;

     var formType = Xrm.Page.ui.getFormType();
     if (formType == FORM_TYPE_CREATE)

    {

    Xrm.Page.getAttribute(new_neworfollowupcall).setValue(null);

    }

    };

    But I get "Error:Object doesn't support property or method "setValue" when the form loads.  Any idea what I'm doing wrong?

    Tuesday, November 4, 2014 11:38 AM

Answers

  • please try new_neworfollowupcall in quotes?.

    regards

    Jithesh

    • Proposed as answer by Guido PreiteMVP Tuesday, November 4, 2014 11:52 AM
    • Marked as answer by NettSales Tuesday, November 4, 2014 11:52 AM
    Tuesday, November 4, 2014 11:45 AM

All replies

  • please try new_neworfollowupcall in quotes?.

    regards

    Jithesh

    • Proposed as answer by Guido PreiteMVP Tuesday, November 4, 2014 11:52 AM
    • Marked as answer by NettSales Tuesday, November 4, 2014 11:52 AM
    Tuesday, November 4, 2014 11:45 AM
  • Thanks Jithesh - working now!
    Tuesday, November 4, 2014 11:52 AM