Options

BOM Upload, help pls?

ppigletppiglet Member Posts: 35
pals..

i tried to import/update BOM header and BOM line in the same time by using dataport. the result is : BOM header get updated but only one or two of the lines (among many item lines) has been updated.
can you tell me why?
i also tried to debug the dataport to find the restrictions during import but it doesnt work ..

anybody can help me?

Comments

  • Options
    kinekine Member Posts: 12,562
    I have no enough info to help you. Can you send for example structure of the dataport and main parts of the C/AL code you have in it? Can you describe structure of the text file?
    Kamil Sacek
    MVP - Dynamics NAV
    My BLOG
    NAVERTICA a.s.
  • Options
    ppigletppiglet Member Posts: 35
    I have no enough info to help you. Can you send for example structure of the dataport and main parts of the C/AL code you have in it? Can you describe structure of the text file?

    ****************************
    for table Production BOM Header (table #99000771)
    i choose filed numbers: 1, 10, 12, 21, 43, 45, 50

    for table Production BOM Line (table #99000772)
    i choose fields numbers: 1, 10, 11, 12, 13, 14, 21, 40, 41, 42, 44, 45

    for the dataport itself, i do not wite any code

    here's the text file
    170663 j2003mat3 PCS New J2003MAT3 08/15/05

    170663 Item 1850 Saddle 0 0 0 0 2 PCS 1
    170663 Item LS-150 Loudspeaker, Cherry, 150W 0 0 0 0 1 PCS 1

    Thanks ...
  • Options
    kinekine Member Posts: 12,562
    Whcih char is "field delimiter"? Space?
    Kamil Sacek
    MVP - Dynamics NAV
    My BLOG
    NAVERTICA a.s.
  • Options
    DenSterDenSter Member Posts: 8,304
    Looks to me like you need to add the line number to the dataport.
  • Options
    SavatageSavatage Member Posts: 7,142
    DenSter wrote:
    Looks to me like you need to add the line number to the dataport.

    i c that 2
  • Options
    ppigletppiglet Member Posts: 35
    FieldStartDelimiter : <None>
    FieldEndDelimiter : <None>
    FieldSeparator : <TAB>
    RecordSeparator : <<NewLine>>
    DataItemSeparator : <<NewLine><NewLine>>

    how to add the line number to the dataport? and why?
    i wrote some dataport and they works well without any line number

    thank you guys ..
  • Options
    kinekine Member Posts: 12,562
    Saatage and DenSter are right...

    The primary Key of Production Bom Line is "Production BOM No.,Version Code,Line No." - it means, to not overwrite lines with same Production BOM No. and Version, you need programatically fill Line No. with numbers like:

    10000
    20000
    30000

    See some manually created BOM lines... if you do not fill Line No. it will be still 0 and it means, that if you have same BOM no. and Version Code, you will still overwriting one line... (with Line No. 0)...
    Kamil Sacek
    MVP - Dynamics NAV
    My BLOG
    NAVERTICA a.s.
  • Options
    DenSterDenSter Member Posts: 8,304
    You only need line number if that field is part of the primary key of the table. Like Kine says, usually these line numbers start at 10000 and are incremented by 10000 for each consecutive line. In a dataport, you will have to assign those numbers either from your source file, or in C/AL code in the OnAfterGetRecord trigger.
  • Options
    ppigletppiglet Member Posts: 35
    the problem solved!
    thank you very much guys ......

    bets!
Sign In or Register to comment.