Temporary Order. FindPrice

sanojsanoj Member Posts: 19
Hi,

I'm using a temporary order to find the customers price. But as I can see there are a lot of overhead using this method. It seems like it creates Document Dimension, check inventory and so on.

Is there a way to make this faster? Can I disable some features to make it faster?

Thanks,

Jonas

Comments

  • kinekine Member Posts: 12,562
    I am using this function which I created in the CU 7000
    FindCustomerPrice(ItemNo : Code[20];CustID : Code[20];QtyParam : Decimal;UOM : Code[20];ToDate : Date;VAR LineDisc : Decimal;VAR UnitPr
    IF NOT Cust.GET(CustID) THEN
      CLEAR(Cust);
    Item.GET(ItemNo);
    IF ItemUOM.GET(ItemNo,UOM) THEN
      SetUoM(QtyParam,ItemUOM."Qty. per Unit of Measure")
    ELSE
      SetUoM(QtyParam,1);
    
    FindSalesPrice(TempSalesPrice,CustID,'',Cust."Customer Price Group",'',ItemNo,'',UOM,'',ToDate,FALSE);
    CalcBestUnitPrice(TempSalesPrice);
    
    IF FoundSalesPrice THEN BEGIN
      UnitPrice := TempSalesPrice."Unit Price";
      FindSalesLineDisc(
        TempSalesLineDisc,CustID,'',Cust."Customer Disc. Group",'',ItemNo,Item."Item Disc. Group",'',
        UOM,'',ToDate,FALSE);    CalcBestLineDisc(TempSalesLineDisc);
      LineDisc := TempSalesLineDisc."Line Discount %";
    END;
    
    Kamil Sacek
    MVP - Dynamics NAV
    My BLOG
    NAVERTICA a.s.
Sign In or Register to comment.