get data from table

axBobSEaxBobSE Member Posts: 17
edited 2008-06-19 in Navision Financials
I got a small problem I cant seem to get this to work

bom_Salgsfakturahoved - OnPreDataItem()
InvoiceNum := 'F1000000';                       //global variable set to invoiceNum (change to dynamic)
SETRANGE("Nummer",InvoiceNum);                  //range on this dataItem

IF (EVALUATE(globalInt,"Kundenr.")) THEN BEGIN
global_debitor.GET(globalInt);
END
//global_debitor.GET('5173');

if I just type in the number its no problem both fields are of the same type code tried to do it in different ways but it wont do as I want it to :(

if I write global_debitor.GET("Kundenr."); as I thourth first would work since they are both type <Code> I get a error message saying it cant find Nummer "" on Debitor (the table subtype of global_debitor)

also tried.
global_debitor.INIT;
global_debitor.SETRANGE(Nummer,"Kundenr.");
(but I think I miss something here to select it?)

Answers

  • DaveTDaveT Member Posts: 1,039
    Hi Bob,
    global_debitor.GET("Kundenr.");
    
    is the way to go. What you're missing is a find('-') on the default table - I assume this is a report and it will only get the records in the onaftergetrecord trigger.
    Not sure what you are tring to achieve?
    Dave Treanor

    Dynamics Nav Add-ons
    http://www.simplydynamics.ie/Addons.html
  • axBobSEaxBobSE Member Posts: 17
    :^o Oh yes ofc it woudnt be able to use the "kundern." untill in the (omAfterGetRecord) :(
    Not sure what you are tring to achieve?
    Im making a report that shows surten datas (kinda like a Invoice) and at the same time saving them to a file my desk (like a , seperated file just with ~'s as the seperators)

    The report and file start off with some data depending on the Salgsfakturahoved (CustInvoiceJour) and data from the Debitor table (CustTable) and then under it there will be all the lines on Salgsfakturalinie (CustInvoiceTrans) that refer to the Salgsfakturahoved with a surten "Bilagsnr." (InvoiceId) - Hope that made any sence, we have a customer that wants to recive these kind of invoices from us so they can read them into what ever program/database it is they use.

    The names in () is what they are called in Axapta my Navision got all danish named tables can be a bit anoying when working with it.

    Thanks again. DaveT
Sign In or Register to comment.