import vendordata with no.

paerenpaeren Member Posts: 13
I have exportet vendor data from NAV 2.0 to acsi txt. Now I want to import the data to NAV 5.0 T_23 Vendor which is quite simple.......BUT

I have created a numbersequence (VE0001) which works when I simply insert via the vendor card form.

how do I activate the Vendor No. to increse VE0002 during import (dataport?)

I have tried with vendor.insert(TRUE); in OnAfterImportRecord and in onInsert in the vendortable which didnt work (error: Vendor no. VE0001 does already exists)..... huh..pleace increase on insert

Comments

  • AlbertvhAlbertvh Member Posts: 516
    Hi Paeren,
    in the on BeforeImport you could do the following
    VendNo := INCSTR(VendNo);
    "No." := VendNo;
    

    Define VendNo as a variable of Type Code Length 20

    and in the PreDataItem
    VendNo := 'VE000';

    Hope this helps
  • kinekine Member Posts: 12,562
    Do not forget to clear the record before import (between import of each line). It means add something like
    CLEAR(Vendor);
    
    in BeforeImportRecord trigger. In this case, the INSERT(True) will work for you (in your case the PK is still filled with first no. and thus failing on inserting the record with same PK).
    Kamil Sacek
    MVP - Dynamics NAV
    My BLOG
    NAVERTICA a.s.
  • paerenpaeren Member Posts: 13
    Made it work.

    if I create my own numbers, the T_308 no. series will not be updated.

    I used the following:

    before import - Clear(Vendor);
    after import - Insert(True);

    The real timewaste was when i ran the dataport from the dataport designer.

    Todays lesson: dont run the codeunit from the dataport designer. Run it from the object designer.
Sign In or Register to comment.