1

I'm trying to retrieve a list of all payments received/entered into a Sage Line 50 database. The company I work for are members of the Sage developer program, so I have access to the SDK, help files and the like but I have been unable to find any specific information regarding payments.

Some of the .dta files contain references to payments (SPLITS.DTA & HEADER.DTA) alongside Invoice rows.

Does anyone know whether or not there is a separate file which contains only payment information, and if so what is it? Alternatively, will I have to pull the full list of rows from the SPLITS/HEADER files and filter them by type?

Many thanks in advance

musefan
  • 47,875
  • 21
  • 135
  • 185
Graham Cuthbert
  • 152
  • 1
  • 10
  • I am also looking to get this information. I actually want "Debit" information aswell, but I cannot work out how to tell if a SplitData record is a "Credit" or "Debit" - I don't think the transaction type is enough to tell this. Did you work it out in the end? – musefan Oct 06 '11 at 11:33
  • No, I've been working on different sections of the app until today. I retrieved a list of invoices today and that had very little information. I'm going to pull out the header and split data this afternoon and analyse the results in the debugger. I'll keep you posted. – Graham Cuthbert Oct 06 '11 at 11:50

1 Answers1

1

I pulled data from the Header and Split files for a test customer this afternoon, and they contain (as near as I can tell) all customer activity - Invoices, Invoice payments and Credits are all reflected in both data files (the split data file containing more in depth data) and can be filtered by bank_code and transaction type.

To get the data - first create a reference to a customer object and from there link to all of the header (assuming you have an existing connection and workspace).

dynamic workspace = this._workspaces[workspaceName];
dynamic customer = workspace.CreateObject("SalesRecord");

bool added = customer.AddNew();

customer.MoveFirst(); //find first customer

dynamic headerObject = customer.Link;

bool headerFound = headerObject.MoveFirst(); //use .MoveNext() to cycle headers

You can then pull data from the header object using :

string AccountRef = headerObject.Fields.Item("ACCOUNT_REF").Value;

Where ACCOUNT_REF is a field in the HeaderData object.

Use the following code to get split data

dynamic splitObject = headerObject.Link;

bool splitFound = splitObject.MoveFirst()  //and so on
Graham Cuthbert
  • 152
  • 1
  • 10
  • As you have used the Link method of the customer record I think I should highlight a bug Sage are aware of with that method for another Entity. The other Entity is "Nominal" - if you use Nominal.Link it will currently (as of 10/10/2011) return junk information instead of the SplitData it is supposed to return - I have no information on when Sage plan on fixing this bug, just something to keep in mind – musefan Oct 10 '11 at 07:56