locked
CRM 2011 - Service Activity RRS feed

  • Question

  • Hi there, I wonder if anyone can help me with this? I have modified the Service Activity form so that "Show Time As" selections are Open/Tentative or Scheduled/Reserved. However, I want to set "Show Time As" when creating a new Service Activity so it defaults to Open/Tentative. At the moment it defaults to Scheduled/Reserved. I cannot see a way of setting this.

    Thanks


    BM

    Monday, February 13, 2012 1:28 PM

Answers

  • Thanks Ramu. Worked a treat. Onload form script ended up as:

    function Service_Activity_1()
    {
      if(crmForm.FormType ==1)
         {
             Xrm.Page.getAttribute('statuscode').setValue(2);
          }
    }

    This set the statuscode from Reserved (4)  (which was coming up as the default) to Tentative (2).

    Thanks again.


    BM


    • Edited by BillyBoy9991 Wednesday, February 15, 2012 12:45 PM
    • Marked as answer by BillyBoy9991 Wednesday, February 15, 2012 12:46 PM
    Wednesday, February 15, 2012 12:45 PM

All replies

  • Hi BM,

    The simplest way to do that is set the default value for that picklist. Go to Settings-->customizations--> goto Service Activity --> double click the 'show time as' attribute and set the default value as 'Open/Tentative'.

    Then publish the customizations and see.

    Thanks and Regards

    Ramu

    • Proposed as answer by Janu_m Tuesday, February 14, 2012 6:04 AM
    Tuesday, February 14, 2012 6:04 AM
  • Hi Ramu. Thank you for reply but that is the first thing I checked. It is already set to the that.

    Bill


    BM

    Tuesday, February 14, 2012 9:19 AM
  • Hi BM,

    Please ensure your customizations are successfully published. Do Publish All once. If still not worked then some is going wrong with your CRM. Don't worry you can achieve that default value using simple JavaScript on the form load event.

    If(crmForm.FormType ==1)
     {
       Xrm.Page.getAttribute(“PicklistSchemaName”).setValue(‘yourPicklistValue’); //Give value here not the Text
     }

    Thanks and Regards

    Ramu

    • Proposed as answer by Janu_m Wednesday, February 15, 2012 4:36 AM
    Wednesday, February 15, 2012 4:36 AM
  • Thanks Ramu. Worked a treat. Onload form script ended up as:

    function Service_Activity_1()
    {
      if(crmForm.FormType ==1)
         {
             Xrm.Page.getAttribute('statuscode').setValue(2);
          }
    }

    This set the statuscode from Reserved (4)  (which was coming up as the default) to Tentative (2).

    Thanks again.


    BM


    • Edited by BillyBoy9991 Wednesday, February 15, 2012 12:45 PM
    • Marked as answer by BillyBoy9991 Wednesday, February 15, 2012 12:46 PM
    Wednesday, February 15, 2012 12:45 PM
  • Hi BM,

    Feeling very happy because my Post/Reply helped you.

    Thanks and Regards

    Ramu

    Thursday, February 16, 2012 5:10 AM