CRM 2011 : SetSubmitMode with currency RRS feed

  • Question

  • Hi,

    I am not sure whether this is bug or I am doing it bit wrong.

    I have a custom currency field on my invoice form and it's kept disabled as it is calculated field. To make it's value saved to DB I applied script like Xrm.Page.getAttribute("new_field").setSubmitMode("always") on form save, however the value is getting stored in a DB but not to the actual field "new_field" but instead to "new_fieldbase" field. where base field is not put even on form. but although it is updating and the actual field is value is not getting saved.

    Any Idea ?

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

    Tuesday, July 30, 2013 2:01 PM

All replies

  • If you create a new currency field, you will always get two fields (prefix_yourfieldname and prefix_yourfieldname(base)). While prefix_yourfieldname should contain the value for your choosen currency, prefix_yourfieldname(base) will always contain the value in base currency. To get this working you have to make sure that currency field is available on form as well and you set the currency.

    You did not mention if you update the calculated value by JScript or by a plugin so I would check, if you´ve selected the correct fields to update.

    Carsten Groth http://carstengroth.wordpress.com Microsoft Dynamics Certified Technology Specialist, MVP für Microsoft Dynamics CRM

    Tuesday, July 30, 2013 4:25 PM
  • As said by Carsten check if there is any logic written through js or plugin and make sure you are not swapping values

    Our Website | Our Blog | Follow US | My Facebook Page | Microsoft Dynamics CRM 2011 Application Design
    Make sure to "Vote as Helpful" and "Mark As Answer",if you get answer of your question.

    Tuesday, July 30, 2013 4:41 PM
  • Hi Carsten,

    Yes I have both the currency field and currency are on form. we have only single currency in USD.

    Although base field is not put on form. when we hit save base field is getting updated with recent value but the main field is still retaining old value.

    I have jscript on change of some fields which calculates the value. There isn't any script on form that might have been overwriting this field.

    Also, I am not sure when the base field is not on form then why it's value is updating ? 

    Thanks for looking at mate.

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

    Wednesday, July 31, 2013 7:23 AM