tags:

views:

29

answers:

2

Hi All,

I have access to the SQL database the Navision data is stored on, and I have some credit details from my client but I can't find them within $Sales Invoice Header - Have I just got inccorect details from client, or are the credits stored else where?

I can't see any obvious tables.

Cheers

Shane

A: 

You should never really interact with the SQL tables directly as it bypasses all of NAV's business logic which is stored in the objects.

What does the number you have look like? INVX? PO? Can you post the number or a sample of it here? Then we can point you in the right direction to access the details within NAV.

Update (6/23) based on the comments below.

The invoice credits will probably be stored as Sales Invoice Lines associated with the Sales Invoice Header. The following SQL query should get you all the lines associated with the header:

SELECT *
  FROM [NAV].[dbo].[CompanyName$Sales Invoice Line]
 WHERE [Document No_] = 'INVX-0000001'
    GO

Obviously change NAV to your DB name and CompanyName to the appropriate company name within NAV.

Did this work?

Rob Burke
Hi Rob,I'm only accessing SQL for read only - I'm extracting data out and posting some information into the website db.All I have is a number, posted date, amount, and customer name but when I look into [$Sales Invoice Header] table no information there for that date / customer, hence why I was asking if credits were stored else where
Shane
The data is probably stored in the [$Sales Invoice Line] table as a line on the invoice relating to the [$Sales Invoice Header] table. I've edited my answer to include a SQL query which should get you the information you're looking for.
Rob Burke
Hi Rob - Sorry for the delay only just managed to get back onto this project... I've searched the table with all the information I've been given from client but I can't see anything in there. I think I've been given incorrect details.Just to double check - Is there a query I can do to get back all credits? i.e. Is there a column which flags if the invoice is a credit - i see there is 'Type' would that be it? Or is the value a minus figure?
Shane
A: 

For anyone else who is stuggling with this, the credits are stored in;

[DB$Sales Cr_Memo Header] [DB$Sales Cr_Memo Line]

Shane

related questions