Importing vendors with city / post code

kamranshehzadkamranshehzad Member Posts: 165
Hi I am trying to import the vendors with post code and customers.

I know i have to link it with Post Codes table but still its not importing the data in. it throws the error.

Microsoft Dynamics NAV Classic
You must specify Code in Post Code Code='',City='London'.

OK


Any advice?

regards,
KS

Answers

  • ara3nara3n Member Posts: 9,256
    turn on the debugger, and see where it stops and why. My guess you are validating City before the Post code and you have a modification that writes it to the post code table.
    Ahmed Rashed Amini
    Independent Consultant/Developer


    blog: https://dynamicsuser.net/nav/b/ara3n
  • kamranshehzadkamranshehzad Member Posts: 165
    I am using xml port to import the vendors into the system. so the structure of port is like

    Vendors (Vendors table)
    -- Vendor
    -- No
    -- Name
    -- VendCity (Post Code table)
    -- City
    -- Code


    Any idea/
    KS
  • DenSterDenSter Member Posts: 8,304
    It appears that you are importing into the Post Code table as well as the vendor table. The Code field of that table must have a value, so you will have to make sure that this is the case. By the way, it is not technically necessary to have a record in the Post Code table for the Vendor table to accept a value in the Post Code field. The table relationship in that field is not enforced.
  • ara3nara3n Member Posts: 9,256
    Yes remove the post code table from your xmlport.
    Ahmed Rashed Amini
    Independent Consultant/Developer


    blog: https://dynamicsuser.net/nav/b/ara3n
  • kamranshehzadkamranshehzad Member Posts: 165
    yes but that throws an error as when it goes on validating table 23 ( while importing through xmlport )for city and post code.
    it can't validat as it goes to table "post code" to validate the input.

    any recommendations?

    regards,
    kamran
    KS
  • ara3nara3n Member Posts: 9,256
    don't validate the fields. There is a property FieldValidate that you can change to no.
    Ahmed Rashed Amini
    Independent Consultant/Developer


    blog: https://dynamicsuser.net/nav/b/ara3n
  • DenSterDenSter Member Posts: 8,304
    Or... import into a text variable and set the field from one of the dataitem triggers.
  • themavethemave Member Posts: 1,058
    DenSter wrote:
    Or... import into a text variable and set the field from one of the dataitem triggers.
    or import your post codes first, and be done with them, I used a online service to load the entire us post code database. took a couple of minutes.
  • DenSterDenSter Member Posts: 8,304
    By far the best solution, I agree :mrgreen: which one did you use?
  • kamranshehzadkamranshehzad Member Posts: 165
    FieldValidate ? where in xml port? i tried dat. I tried dat it did not work.

    loading all post codes is not a good idea in my view (outside usa):P

    ill give a try to other idea of creating a postcode first then doing the rest of import..

    any other suggestion is welcome.

    regards,
    KS
Sign In or Register to comment.