getDataValue vs getFormValue

 1 Replies
 0 Subscribed to this topic
 12 Subscribed to this forum
Sort:
Author
Messages
Angela Collins
Basic Member
Posts: 20
Basic Member

    I have asked several people what the difference is other than using the id/name versus the data source, but the answer I get is try the one.  If it doesn't work, try the other.  I put both in an On Blur event.  I noticed that getFormValue gives you the value of the field that you entered/selected while getDataValue gives you the original value.  If I have ABC in the field and change it to XYZ, getFormValue returns XYZ while getDataValue returns ABC.  Is this documented somewhere?

    I noticed that the person put in both setDataValue and setFormValue every time a field is valued.  Is there a good reason or is it because that person did not understand the difference?

    Randall
    Veteran Member
    Posts: 44
    Veteran Member
      getFormValue and setFormValue will set what you actually see on the screen (in a textbox, title, etc.).

      getDataValue and setDataValue will set and retrieve the actual data that's going to an from Lawson.

      If you perform an inquire that populate screen fields, the data and form values are the same.  However, if you were to type in a different value to a field, your getFormValue function will return what you've typed.  If you use the getDataValue functions, it will return the value that was returned from the Lawson call.

      Likewise with the setFormValue and setDataValue.  If you use setFormValue, you will set a field value that is actually displayed on the screen.  The setDataValue will set field data that you want as you update a form.  setFormValue would come in handy if you want to default form fields for a user.  setDataValue comes in handy if you're populating hidden fields, or wanting to make sure the correct data is being passed through edit checks, regardless of what the user has entered.

      This is what I've found at least.  If anyone has any other experiences, please feel free to share.

      Hope this helps,
      Randall