locked
help in java script code RRS feed

  • Question

  • hi there,

    I am brand new to Ms dynamic crm2011 if any body help.thanks in advance

    I have a scenario where an order entity has  used as purchase order and sales order .A picklist field used as  suplier /Customer.

    Another lookup filed used for contact.through this lookup contact entity populate name,address,email automatically.

    I want to clear/empty lookup on form _load event so that customer can input new data in the field  .also the Address information like contact name ,phone,email  should be clear/empty on form onload event.every time if new contact selected

    Wednesday, July 31, 2013 11:26 PM

All replies

  • hi there,

    I am brand new to Ms dynamic crm2011 if any body help.thanks in advance

    I have a scenario where an order entity has  used as purchase order and sales order .A picklist field used as  suplier /Customer.

    Another lookup filed used for contact.through this lookup contact entity populate name,address,email automatically.

    I want to clear/empty lookup on form _load event so that customer can input new data in the field  .also the Address information like contact name ,phone,email  should be clear/empty on form onload event.every time if new contact selected

    I think that will do the job for you:

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

    • Proposed as answer by crm-user-crm Thursday, August 1, 2013 6:23 AM
    Thursday, August 1, 2013 6:23 AM
  • Hi,

    You can use the below code. 

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

    If the field is read only, than you have to set the submitmode as well. in your case it is not necessary as your fields are editable.

    Xrm.Page.getAttribute(field).setSubmitMode("always");

    Thanks!

    • Proposed as answer by Kalim Khan Monday, August 5, 2013 9:06 AM
    Sunday, August 4, 2013 8:04 AM