Structure order line details Form PROBLEM!!!

Hi,
From purchase order when i enter the structure order line details the form hangs and ill have to open new session of NAV!! ](*,) Please help :( [-o< [-o<

Comments

  • Hi the structure order line details table has 11 million records so when we try to open structure order line details from purchase order the navision hangs.
    the code on purch line form is


    StrOrderLineDetails.RESET;
    StrOrderLineDetails.SETRANG(Type,StrOrderLineDetails.Type::Purchase);
    StrOrderLineDetails.SETRANGE("Document Type","Document Type");
    StrOrderLineDetails.SETRANGE("Document No.","Document No.");
    StrOrderLineDetails.SETRANGE("Item No.","No.");
    StrOrderLineDetails.SETRANGE("Line No.","Line No.");
    StrOrderLineDetailsForm.SETTABLEVIEW(StrOrderLineDetails);
    StrOrderLineDetailsForm.RUNMODAL;
    END;

    PLEASE HELP [-o<
  • Try setting appropriate key using SETCURRENTKEY on the StrOrderLineDetails Rec variable ..... :-k

    StrOrderLineDetails.RESET;
    StrOrderLineDetails.SETCURRENTKEY(***,***,***,,,,,,);
    StrOrderLineDetails.SETRANG(Type,StrOrderLineDetails.Type::Purchase);
    StrOrderLineDetails.SETRANGE("Document Type","Document Type");
    StrOrderLineDetails.SETRANGE("Document No.","Document No.");
    StrOrderLineDetails.SETRANGE("Item No.","No.");
    StrOrderLineDetails.SETRANGE("Line No.","Line No.");
    StrOrderLineDetailsForm.SETTABLEVIEW(StrOrderLineDetails);
    StrOrderLineDetailsForm.RUNMODAL;
    END;
    Sandeep Prajapati
    Technical Consultant, MS Dynamics NAV
  • hi,
    i tried

    StrOrderLineDetails.RESET;
    StrOrderLineDetails.SETCURRENTKEY(Type,"Document Type","Document No.","Item No.","Line No.");StrOrderLineDetails.SETRANGE(Type,StrOrderLineDetails.Type::Purchase);
    StrOrderLineDetails.SETRANGE("Document Type","Document Type");
    StrOrderLineDetails.SETRANGE("Document No.","Document No.");
    StrOrderLineDetails.SETRANGE("Item No.","No.");
    StrOrderLineDetails.SETRANGE("Line No.","Line No.");
    IF StrOrderLineDetails.FIND('-') THEN
    BEGIN
    StrOrderLineDetails.SETCURRENTKEY(StrOrderLineDetails."Calculation Order");
    StrOrderLineDetailsForm.SETTABLEVIEW(StrOrderLineDetails);
    StrOrderLineDetailsForm.RUNMODAL;
    END;;

    still does not help but when i comment
    StrOrderLineDetails.SETCURRENTKEY(StrOrderLineDetails."Calculation Order"); then its very fast but structure calculation order will not be sorted!
  • Hi Suvidha,
    IF StrOrderLineDetails.FIND('-') THEN
    if the DB version is > 3.7
    change the FIND('-') to findfirst
    Sandeep Prajapati
    Technical Consultant, MS Dynamics NAV
  • Hi Suvidha,

    Could you consider making a new key in the table
    ["Calculation Order",Type,"Document Type","Document No.","Item No.","Line No."] and then

    StrOrderLineDetails.RESET;
    StrOrderLineDetails.SETCURRENTKEY("Calculation Order",Type,"Document Type","Document No.","Item No.","Line No.");
    StrOrderLineDetails.SETRANGE(Type,StrOrderLineDetails.Type::Purchase);
    StrOrderLineDetails.SETRANGE("Document Type","Document Type");
    StrOrderLineDetails.SETRANGE("Document No.","Document No.");
    StrOrderLineDetails.SETRANGE("Item No.","No.");
    StrOrderLineDetails.SETRANGE("Line No.","Line No.");
    IF StrOrderLineDetails.FINDFIRST THEN
    BEGIN
    // removed
    StrOrderLineDetailsForm.SETTABLEVIEW(StrOrderLineDetails);
    StrOrderLineDetailsForm.RUNMODAL;
    END;
    Sandeep Prajapati
    Technical Consultant, MS Dynamics NAV
  • hey thanks for reply the problem was with DB fragmentation i had to Run DBCC DBREINDEX SQL side... :P