web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics NAV (Archived)

Wanna fetch Start Date and End Date from Sale price Table

(0) ShareShare
ReportReport
Posted on by 1,751

Hi All

i have to show start date and end date of an item if the sales price exist ,in the sales order confirmation report.i though of using PriceCalcMgt.FindSalesLinePrice(SalesHeader,Rec,CalledByFieldNo); from sales line table but i am confused as sales line is passed by refernce and i dont want to make any change to the current sales order line .kindly suggest how can i achieved this without changing this function PriceCalcMgt.FindSalesLinePrice.

Thanks in advance

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    Stefano Demiliani Profile Picture
    37,166 Most Valuable Professional on at

    You can simply open your report and in OnAfterGetRecord of the Sales Line dataitem you can filter table 7002 (Sales Price) for Item No. = SalesLine."No." and then retrieve the dates you want.

    If you want to use the natve function FindSalesLinePrice you need to add the two date fields to table 36 and then add a piece of code to evaluate these fields in the function FindSalesLinePrice when the correct price is retrieved from table 7012.

    Then in your report you've only to read the Sales Line record.

  • Suggested answer
    nav.mukesh Profile Picture
    619 on at

    Use the following functions in CU7000 Sales Price Calc. Mgt. -

           FindSalesPrice(

             TempSalesPrice,"Bill-to Customer No.",ServHeader."Contact No.",

             "Customer Price Group",'',"No.","Variant Code","Unit of Measure Code",

             ServHeader."Currency Code",ServHeader."Order Date",FALSE);

           CalcBestUnitPrice(TempSalesPrice);

    TempSalesPrice is a temporary variable that you need to pass and rest information you can get based on Sales Header and Sales Line.

    This would not modify the Sales Line.

  • javedakhtar Profile Picture
    1,751 on at

    Dear Stefano,

    i cannot add new fields to sales line table that is the limitation of my requirment.

  • javedakhtar Profile Picture
    1,751 on at

    Hi Mukesh ,

    it will only return me the price not date .

  • Suggested answer
    Stefano Demiliani Profile Picture
    37,166 Most Valuable Professional on at

    FindSalesPrice returns the Sales Line with the price and discount assigned. The variable is passed by Reference. If you want to retrieve the price dates on that function, you need to add a piece a code on that that reads the dates from table 7012 (and this is easy). But where you want to store that values? If you want to show them on the Sales Line, fields are necessary if you want to use the FindSalesPrice way.

    Otherwise, add another possible way for not creating fields on Sales Line is to create a custom function that reads table 7012 and returns a date and then call it as a SourceExpression of a column you will add in Sales Line subform.

  • Suggested answer
    nav.mukesh Profile Picture
    619 on at

    It will return the complete Sales Price record which has the Start Date and End Date of the price that would have got applied on the Sales Order.

  • javedakhtar Profile Picture
    1,751 on at

    Hi Mukesh Sir ,

    i tried first taking Sales Price Calc. Mgt. as variable and calling the function  CalcBestUnitPrice but its local function ,

    secondly i tried using copying the function from  Sales Price Calc. Mgt.but there are some global variable that is getting set in different condition .

  • Suggested answer
    nav.mukesh Profile Picture
    619 on at

    Hi Javed,

    You can change the property of the function to make it Non-Local and use it.

    Copying the function will definitely not work due to the depency on other functions as well.

    Regards,

    Mukesh Verma

  • javedakhtar Profile Picture
    1,751 on at

    IF SH.GET("Sales Header"."Document Type","Sales Line"."Document No.") THEN ;

    SL1.RESET;

    SL1.SETRANGE("Document Type","Sales Line"."Document Type");

    SL1.SETRANGE("Document No.","Sales Line"."Document No.");

    SL1.SETRANGE("Line No.","Sales Line"."Line No.");

    IF SL1.FINDFIRST THEN BEGIN

     PriceCal.FindSalesPrice(

         TempSalesPrice,SL1."Bill-to Customer No.",SH."Bill-to Contact No.",

         SL1."Customer Price Group",'',SL1."No.",SL1."Variant Code",SL1."Unit of Measure Code",

         SH."Currency Code",SH."Order Date",FALSE);

         IF TempSalesPrice.FINDFIRST THEN

           PriceCal.CalcBestUnitPrice(TempSalesPrice);

     END;

    error is coming that my sales price table is empty

  • nav.mukesh Profile Picture
    619 on at

    The code seems to be correct. Do you have Sales Price for the Item for the combination?

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics NAV (Archived)

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans