locked
[crm 2013] [unsupported] crmFormSubmit.newStatusCode.value RRS feed

  • Question

  • Hi Folks,

    We have used old JavaScript statement in CRM 4.0 as following.

    crmFormSubmit.newStatusCode.value

    As we have moved into CRM 2011 the function was still supported which was used to check phone call status when "close Phone call" is performed before the record is being actually saved.

    Moving ahead to 2013 this function is unsupported now. do you guys have an idea of any supported 2013 way for mentioned JavaScript lines.

    Any help would be appreciated.


    Thanks and regards,
    Hiren Solanki.
    Please vote or mark as a answer if it helped you.

    Friday, October 18, 2013 9:10 AM

All replies

  • Hi,

    Please downland following tool and check the post

    http://www.microsoft.com/en-us/download/details.aspx?id=30151 

    http://blogs.msdn.com/b/crm/archive/2013/08/23/check-your-javascript-code-to-prepare-for-your-upgrade.aspx


    Hope this helps. If you get answer of your question, please mark the response as an answer and vote as helpful !
    Vikram !

    • Proposed as answer by _Vikram Friday, October 18, 2013 9:15 AM
    Friday, October 18, 2013 9:14 AM
  • Hi Vikram,

    I do not need to check with tool I've already performed that check. Even I checked the given script in CRM 2013 and it's not working. I need alternate script syntax which can work on 2013.


    Thanks and regards,
    Hiren Solanki.
    Please vote or mark as a answer if it helped you.

    Friday, October 18, 2013 10:00 AM
  • Hi Hiren,

    Please try like as below and make sure statuscode field placed on the enttiy From :

    var Value=Xrm.Page.getAttribute('statuscode').getValue();


    Hope this helps. If you get answer of your question, please mark the response as an answer and vote as helpful !
    Vikram !

    Friday, October 18, 2013 10:17 AM
  • That can be used once form is saved and status code is updated. I need status code value before it is actually updated.

    Thanks and regards,
    Hiren Solanki.
    Please vote or mark as a answer if it helped you.

    Friday, October 18, 2013 10:28 AM
  • In that case you could create new hidden text field to store old StatusCode field value (Write JS code to get old StatusCode value from database) and use hidden field in Onsave event to get old StatusCode value.

    Hope this helps. If you get answer of your question, please mark the response as an answer and vote as helpful !
    Vikram !

    Saturday, October 19, 2013 5:00 AM
  • Thanks for your help. I am still unanswered as found that this is something which isn't anywhere in CRM 2013 SDK. need to find some other alternative for this stuff.

    Thanks and regards,
    Hiren Solanki.
    Please vote or mark as a answer if it helped you.

    Monday, October 21, 2013 6:18 AM
  • Hi.

    What you can try is this:

    1. Create a JavaScript file as a container with some pre-defined fields.

    var accountPreviousStateCode = 0;

    2. Assign the value in onLoad event of the form (use the javascript file as a library in onLoad)

    if (Xrm.Page.getAttribute("statecode").getValue() != null) 
    {
      accountPreviousStateCode = Xrm.Page.getAttribute("statecode").getValue();
    } 

    3. Call the value from onChange, onSave to check the previous value (use the javascript file as a library in onChange, onSave)

    var newAccountStateCode = Xrm.Page.getAttribute("statecode").getValue();
    alert("The new value is:" + newAccountStateCode );
    alert("And here is the previous value" + accountPreviousStateCode);

    Jaimie
    • Edited by Jaimie Ji Monday, October 21, 2013 11:23 AM
    Monday, October 21, 2013 11:21 AM