locked
Update a Field on Phone call Form whenever user closes Phone Call - Javascript only RRS feed

  • Question

  • Dear Sir,

    Scenario MS CRM 4 - Whenevr user closes a phone call by going to Actions - Close Phone Call and selects Completed Status, I want to update a field on Phone Call to the value of Status.

    I want to do this through Javascript. Is is possible? How do I achieve this?


    Thanks and Regards, Abbas MS CRM Consultant
    Friday, July 29, 2011 11:37 AM

Answers

  •  I don't think you can update the phone call when the status of the phone call is closed.

    I would suggest use workflow on status change. Check if your custom field is empty,change the status back to open, update the field and change the status again.

    I hope it helps


    Amreek singh Senior CRM Consultant CDC Praxa Sydney,Australia http://mscrmshop.blogspot.com/

    Friday, July 29, 2011 2:19 PM

All replies

  • Dear Sir,

    Scenario MS CRM 4.0 - Whenever a User closes the phonecall and selects status completed, I want to modify a field on PhoneCall Form to that of the changed status.

    How do i do that using Javascript only?


    Thanks and Regards, Abbas MS CRM Consultant
    Friday, July 29, 2011 11:31 AM
  • Use this JavaScript and register it OnSave method:

     

    crmForm.all.new_yourfield.DataValue = crmForm.all.statuscode.SelectedText;

     

    KG


    My Dynamics CRM Blog: http://bovoweb.blogspot.com
    Friday, July 29, 2011 11:53 AM
  • Thanks for the reply.

    But unfortunately not working, it gives an error saying crmForm.all.statuscode object not avalaible.

    Any alternative solution?


    Thanks and Regards, Abbas MS CRM Consultant
    Friday, July 29, 2011 2:00 PM
  •  I don't think you can update the phone call when the status of the phone call is closed.

    I would suggest use workflow on status change. Check if your custom field is empty,change the status back to open, update the field and change the status again.

    I hope it helps


    Amreek singh Senior CRM Consultant CDC Praxa Sydney,Australia http://mscrmshop.blogspot.com/

    Friday, July 29, 2011 2:19 PM
  • Thanks.

    Just a quick question - How can we get current status code for an entity using Javascript?


    Thanks and Regards, Abbas MS CRM Consultant
    Friday, July 29, 2011 2:27 PM
  • Did you tried to add statuscode to the form and then run this code ?

    KG


    My Dynamics CRM Blog: http://bovoweb.blogspot.com
    Friday, July 29, 2011 3:04 PM
  • But it doesn't show the new changed status. It always shows OPEN while I close it with COMPLETED.
    Thanks and Regards, Abbas MS CRM Consultant
    Friday, July 29, 2011 3:12 PM
  • Quick question for you: Why you want to add custom field with Status when you can publish status field on Form ?

     


    My Dynamics CRM Blog: http://bovoweb.blogspot.com
    Friday, July 29, 2011 3:51 PM
  • It is the statecode that you after, not the status code.  You'll need to use the workflow example to do this or create a plug-in that fires before the record statecode is changed to Closed, Completed,etc.

    Regards, Donna

    Wednesday, August 3, 2011 2:49 PM