Update to exclude blank fields

tazzy30tazzy30 Member Posts: 52
edited 2009-01-21 in Navision DOS
Hello everyone,

I have a customer update form, the update works fine however if a field is left blank i.e. Name as this is not a field that is required to be updated, when the update is run it changes the name on the customer card to blank, likewise with all the other fields is there an easier way of ignoring the fields that are blank when updating the customer card or would i need to write code for each individual field?

Thank You

Comments

  • DenSterDenSter Member Posts: 8,304
    It seems like you have a special form that you are using to gather values to update a customer record, but you are not telling us exactly how it works. Without that information all we can do to help is make assumptions and guess.

    Standard NAV does not have a special form to update master records, everything is done on the Card. Is there a reason why you have chosen not to follow this standard?
  • tazzy30tazzy30 Member Posts: 52
    Thank you for your reply,

    Sorry for the lack of description, the customer update form is a holding area for changes that have been made via the web by customers. Those changes will then stay within this form until it has been updated by the user. However it is here when users click update all blank fields (fields that are not updated (remain the same)) replace the values within the customer master card to blank.

    I hope this makes sense, I have put code in to ignore a couple of fields but I have done this for each individual field, I can show you the code?
  • DenSterDenSter Member Posts: 8,304
    Ah so you have a webpage with customer information that you push into NAV, but you want to only update fields that are not blank. What happens when they want to delete a value, so it used to have something, but they want it to be blank, how would that work?

    The most logical way to me would be to replace what is in the database with what is currently on the user's screen. I assume that when they open the webpage, they retrieve the current records out of the database to display on the page, and when they hit 'submit' it gets written back to the database, including all individual field values. I don't understand how you would have one blank field and a non-blank field, where the blank field would overwrite a non-blank value. The user would have to remove that value, which would indicate intent to clear that value, and would be a valid change in the database.

    Am I missing something?
Sign In or Register to comment.