Updating Empty Fields

ifonlyifonly Member Posts: 34
edited 2013-01-29 in NAV Three Tier
I recently had to update multiple Empty Fields (the Salesperson Code had been missed in multiple Customers and in Contacts) when i tried to do this via Replace in Object Designer it would not allow me, if i selected '' as a value for an empty field it returned an error about '''', i did this via the SQL server in the end, what was i doing wrong or is it not possible?

Comments

  • ara3nara3n Member Posts: 9,256
    could you paste your code?
    Ahmed Rashed Amini
    Independent Consultant/Developer


    blog: https://dynamicsuser.net/nav/b/ara3n
  • SavatageSavatage Member Posts: 7,142
    I find that if I use Find & Replace on the same field I'm using a filter on - it will only replace half that need to be replaced. Then I just hit replace again & again - running it multiple times untill all has been replaced.
    1000->500
    500->250
    250->125
    etc..
    etc

    So using find & replace is fine if I find '' & Replace with "x".
    but if I filtered for '' first and wanted to find & replace those filtered results, I get half.

    That's why I make a quick update report, fast, easy, always works.
  • ifonlyifonly Member Posts: 34
    to @ara3n - what code are you looking for?

    @savantage - i had exactly the same, so this could take me at least 10 find & replace tries to update each Salesperson, but that iw when i was for example replacing Salesperson ABC with for DEF, but it did not work for updating an empty salesperson for ABC

    What update report did you create & in what - Nav or SQL
  • ara3nara3n Member Posts: 9,256
    I miss read it thinking you were running a report. I always run a processing report and use a second record variable to modify field that i've filtered on.
    Ahmed Rashed Amini
    Independent Consultant/Developer


    blog: https://dynamicsuser.net/nav/b/ara3n
  • SavatageSavatage Member Posts: 7,142
    For Example - if I wanted to change all my 'XX' salesperson codes to 'ZZ'
    I would create a quick report using the customer dataitem.

    OnAfterGetRecord()
    VALIDATE("Salesperson Code",'ZZ');
    MODIFY;

    When I run the report I filter on Salesperson Code = 'XX'

    it will change all my XX's to ZZ's. Then delete the report since it's not neded anymore.

    Note: make sure you place a filter on your report - all they will ALL get changed!
Sign In or Register to comment.