Sales Invoice No. Confused

Lorneagle
Lorneagle Member Posts: 6
Hi all.

I have a simple problem which is driving me crazy.

I have a variable called SIHeader of Type Record. SubType is Sales Invoice Header.

As far as i understood:
SIHeader.GET("Primary Key Field of Table")

returns one record. The one with the primary key i specified.
So there is an Sales Invoice with the "No." SVR0000001 in the Cronus Sample Database.

But
SIHeader.GET('SVR0000001');
tells me that there is no record with "No." := SVR......

If i RUN the Sales Invoice Header Table i get a list which contains the same Sales Invoice but with a completely different No.

My question. How can i access this No. or better:

How do I get a SINGLE Sales Invoice Record? Which key do i have to use and where can i find it.

PLS HELP!

Comments

  • Lin
    Lin Member Posts: 40
    The sales invoice that you are looking for - Is this a Sales order record with a type of Invoice rather than a sales invoice record ?
  • couberpu
    couberpu Member Posts: 317
    The primary key to sales header is "Document Type" and "No.".
    So the code would be something like
    SIHeader.GET("Document Type"::Invoice,SVR0000001)
    
  • kine
    kine Member Posts: 12,562
    couberpu wrote:
    The primary key to sales header is "Document Type" and "No.".
    So the code would be something like
    SIHeader.GET("Document Type"::Invoice,SVR0000001)
    

    He is reading from "Sales Invoice Header" table...
    i get a list which contains the same Sales Invoice but with a completely different No.

    What do you mean? "Same invoice but different No."? How do you know that it is same invoice, if it has different No.? Different No. from what? Where you got your "correct" invoice No.?

    Please, post more info, it seems that you need to clear some things.
    Kamil Sacek
    MVP - Dynamics NAV
    My BLOG
    NAVERTICA a.s.
  • Lorneagle
    Lorneagle Member Posts: 6
    Now i am REALLY confused. Okay some basic questions :) :

    If i want to manually create an Invoice for an existing order, how do i do that? Do I use the "Invoice" Tab in the Sales Order Form or do I use the Sales Invoice Form. And if u had such an invoice. Can u tell me how you would export this invoice using an XMLPort an maybe give me some codesamples. I'm feeling soooo lost :(

    I just want to export an Invoice to an XML File, i am desperate :( Maybe i am thinking the wrong way ... i'm really stuck


    thx in advance
    Ben
  • Mbad
    Mbad Member Posts: 344
    Lorneagle wrote:
    If i want to manually create an Invoice for an existing order, how do i do that?

    You need to go get some training and read some booklets on NAV. Surely your imployer can help you get started.