locked
Anyone know how to append with Javascript? RRS feed

  • Question

  • Just tried this and it doesn't work:

    var seconds = new Date().getTime() / 1000;
    var type = "CAS";
    var ID = type + "-" + seconds;

    Xrm.Page.data.entity.attributes.get("new_ID").setValue(ID);

    anyone know what I'm doing wrong? Thanks.

    Sunday, May 26, 2013 5:01 PM

All replies

  • Hi Andrea,

    Just try 

    Xrm.Page.getAttribute("new_ID").setValue(ID);


    If this post answers your question, please click "Mark As Answer" on the post and "Vote as Helpful" Thank you, DT

    Sunday, May 26, 2013 5:20 PM
  • Hi Andrea,

    you need to lower case the field name

    var seconds = new Date().getTime() / 1000;
    var type = "CAS";
    var ID = type + "-" + seconds;
    
    Xrm.Page.data.entity.attributes.get("new_id").setValue(ID);


    My blog: www.crmanswers.net

    • Proposed as answer by Linn Zaw Win Sunday, May 26, 2013 5:46 PM
    Sunday, May 26, 2013 5:38 PM
  • Try this,

    Xrm.Page.data.entity.attributes.get("new_id").setValue(ID);


    If you find this post helpful then please "Vote as Helpful" and "Mark As Answer". Thanks and Regards, Yogesh Vijay Mulay

    Monday, May 27, 2013 6:07 AM