Problem - Creation of Variants using Dataport

nodev
nodev Member Posts: 3
Hi,

I am a rookie in Nav. Question: We have a dataimport that import excel file to Item table in Navision. After import, the dataport creates a variant for example - gender and age group.

The imports works well except that it will always prompt me to choose Yes or No in the creation of the item variants. How can I skip this part so that it will just create the variants automatically.

I have tons of data import.

thanks in advance,

nodev

Comments

  • Savatage
    Savatage Member Posts: 7,142
    I don't know about everybody But I guess I need to see some of your code.

    When I import New Items into the item table - I have the "Item Unit Of Measure Table" fill in the base UOM at the same time like this..
    IF "Item Unit Of Measure".GET(Item."No.", Item."Base Unit of Measure") THEN
      VALIDATE(Item."Base Unit of Measure")
    ELSE BEGIN
      "Item Unit Of Measure".Code := Item."Base Unit of Measure";
      "Item Unit Of Measure"."Item No." := Item."No.";
      "Item Unit Of Measure"."Qty. per Unit of Measure" := 1;
      "Item Unit Of Measure".INSERT(TRUE);
      VALIDATE(Item."Base Unit of Measure");
    END;
    

    You have a similar situation .
    Are you using INSERT(TRUE)?
  • nodev
    nodev Member Posts: 3
    Savatage,

    Thanks for the quick response. Appreciated. Here's the portion of the code that create the variants. My unit of measure code is already taken cared of.


    Integer - OnPostDataItem()

    itemRec.RESET;
    IF itemRec.FIND('-') THEN
    REPEAT
    pfsControl.CreateItemVariants(itemRec);
    UNTIL itemRec.NEXT = 0;

    itemRec.RESET;
    IF itemRec.FIND('-') THEN
    REPEAT
    itemRec.VALIDATE("PfsItem Status");
    UNTIL itemRec.NEXT = 0;
  • Saint-Sage
    Saint-Sage Member Posts: 92
    I would try setting a breakpoint somewhere right before that code, and then walking through the code to see what happens. I am not sure but it might be prompting somewhere inside the

    pfsControl.CreateItemVariants(itemRec);

    function. Is pfsControl an automation variable? If so the debugger might not step into that function. Good Luck!

    No one loves you like the one who created you...
  • nunomaia
    nunomaia Member Posts: 1,153
    Can you show the code of CreateItemVariants ?
    Nuno Maia

    Freelance Dynamics AX
    Blog : http://axnmaia.wordpress.com/