locked
Field populated by javascript not committing value RRS feed

  • Question

  • Hi,

    I am auto populating a lookup field with some javascript on form load, when I save the record the value that is placed into the field gets blanked when the form reloads. I have checked both at the very start and very end of my code and the value exists until after the system has exited my code and before it reloads. I have also checked any plugins on this entity and there is no reference to the field there nor can I pick up any value in that field.

    I have found that when I manually set the lookup it works fine, and when I manually change a field that triggers some javascript to populate the field it also saves the value. It seems to be only when the field is set on load of the form automatically

    Can anyone help me with this issue? 

    Thanks


    • Edited by Jimminybob Thursday, June 20, 2013 1:49 PM more info
    Thursday, June 20, 2013 1:40 PM

Answers

  • Sorry, my bad, I've just found the cause for the error.

    The code I was using to retrieve the value had successfully got the name of the record but not its Guid, so it was appearing to successfully set the field, but in fact it wasn't.

    • Marked as answer by Jimminybob Thursday, June 20, 2013 2:05 PM
    Thursday, June 20, 2013 2:05 PM

All replies

  • Can you post the code?

    My blog: www.crmanswers.net

    Thursday, June 20, 2013 2:05 PM
  • Sorry, my bad, I've just found the cause for the error.

    The code I was using to retrieve the value had successfully got the name of the record but not its Guid, so it was appearing to successfully set the field, but in fact it wasn't.

    • Marked as answer by Jimminybob Thursday, June 20, 2013 2:05 PM
    Thursday, June 20, 2013 2:05 PM