Options

how do i get the first record of the table?

spiralspiral Member Posts: 12
edited 2002-10-23 in Navision Financials
hi, i got a problem i had a report dealing with sales header and sales invoice line. i did the relationship data model but the user wants the first record of the sales line displaying only the "description" field after the sales header details are shown. how do i accomplish this?

Comments

  • Options
    MLW222MLW222 Member Posts: 42
    I am not sure exactly where you want sales line description to appear, but here goes:

    Generaly on a report, go to view Sections
    It will show something like this:
    Sales Header Header section
    Sales Header Body section
    Sale Line Body section
    Sales header Footer Section

    If you need one go to Edit insert New and select what you need.
    If you have a section you don't need then click on it and delete.

    In your case, you would put a Label saying "Description" and a Text Box referencing the field you need, e.g./i.e. "Sales Line".Description (Click on Text Box, choose view properties and scroll down to source)
    Alternatively you could use the Filed Menu and selct the field and paste it where you need it.

    Where do you need it?
    That is the question.
    If all you need is the Description from the first sales line for each Sales Header, there is a better way to go at, but let us say you need the description for each Sales Line:
    In that case, place the Label & Text Box in the Body section for the Sales Line.
    The report will automatically start with first sales line, for each Sales Header (assuming you set up Data relation properly).

    As I said, if all you want is the Description for the first sales line. Then dump the Sales Line as a separate DataItem
    Instead define a global, e.g SalesLine, datatype: Record;
    SubType being the Sales line table.
    In the ONAfterGetRecord section of the Header Data Item set up filters to filter sales line table along these lines:
    SalesLine.RESET;
    SalesLine.SETRANGE(Document Type,Sales Header.Document Type);
    SalesLine.SEFITLER(Document No.,Sales Header.Document No.);
    SalesLine.FIND('-');

    The dash tells it to get the first salesline (A '+' would tell it to get the last sales line.)
    Then go to Sections and on Sales Header Body, place a Text Box and for source type in SalesLine.Description.

    This works if all you want is the first sales line, or last or the 3rd., i.e. one sales line.
    If you want all sales line descrptions then do first set up.

    Depending upon what you are doing, if/how you need subtotals, one subline, where you want seperating lines to appear, etc. you might need to play around with adding/deleting headers, footers, bodies, etc.

    Are you familiar with Labels & Text Boxes?

    Hopes this helps.
    Entropy Happens
    Navision Financials 2.0
    blueOrbwise.net
Sign In or Register to comment.